3 ms·
I've been working with selenium a lot at work recently. There are lots of little nuances to grok if you want your tests to run completely deterministic: especia
by alistproducer2 9y ago
I've been working with selenium a lot at work recently. There are lots of little nuances to grok if you want your tests to run completely deterministic: especially on a JavaScript-heavy site.
- danidiaz 9y agoI try to use explicit waits whenever possible. Luckily, the Java client library provides a rich set of combinators for declaring them. You can also define your own; they are basically functions from a WebDriver object to some other thing (usually a Boolean). http://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html http://seleniumhq.github.io/selenium/docs/api/java/org/openq...
- cdubzzz 9y agoOh wow, Java gives you a lot! Python's are actually pretty decent as well, I just came to rely almost entirely on "presence_of_element_located" with our Javascript-heavy app.
- hinkley 9y agoHave you ever gotten completely deterministic tests? I'm starting to think it may not be possible.
- thevalermor 9y agoIndeed, it is possible but requires some effort. Look at this project https://github.com/Skyscanner/pages https://github.com/Skyscanner/pages. Choosing carefully your traits will do the trick.