Subscribe to the full blog feed using RSS
I generally caution against ‘Helper’ classes and Static Helper classes when I’m consulting. SlowLoadableComponent isLoaded methods can be very ugly but are a good example of where helper classes can help, and in particular fluent helper classes.
Fluent Page Objects can help make code easier to write, but we have to be careful not to couple too many classes together.
You have installed the tools? You have an IDE setup? You’ve written and run your first Selenium WebDriver test? What next?
What is the difference between getText and getAttribute? Answer, inside, with some nuances explored.
Q: “Why does Selenium not work with my Alert?” or “Why can’t Selenium handle the alert in my application?”
A: “Because the thing you think is an alert, is not an alert”
TLDR: Selecting an id with a fullstop or period in it requires a little escaping with CSS selectors.
One question that crops up a lot is “Why is my browser not closing?”, and there are multiple reasons for this.
Earlier versions of WebDriver used a
FluentWait class, the
WebDriverWait now offers a fluent DSL approach for configuring the wait.
When using SlowLoadableComponent we have to remember that in the Java Throwable hierarchy the Error and the Exception are siblings. This means that you have to catch exceptions in SlowLoadableComponents and convert them to Errors to cause synchronisation to take place.