Simplelenium, writing robust tests with Selenium

I use Selenium a lot. And I hate it! I hate it and I use it. Every other browser automation tool I’ve used either has the same problems as Selenium or end up dying because nobody uses it. There are nice librairies to make writing Selenium tests more user friendly. Fluentlenium is one of those nice tools. But Selenium’s problem is not really with its syntax. It’s the complexity of writing stable tests. It’s hell!

It would be great if Selenium tests didn’t fail every other day

If you test modern websites with Selenium, you end up playing with waits and timers. Very often people put random Thread.sleep(s) into their test code because they are just fed up trying to understand why sometimes the test passes and sometimes not. The questions you need to ask yourself when you write a Selenium test are:

I’m so upset every time I write Selenium tests or work on Selenium tests written by customers that I finally took some time to write my own layer on top of Selenium and PhantomJS. The prototype is called Simplelenium. With Simplelenium, you should be able to write robusts tests without all theses questions.

There’s a lot missing in this library but I’ve used it in production and my tests are much more stable. Tell me what you think about it.

5 thoughts on “Simplelenium, writing robust tests with Selenium”

  1. Hello David,

    Talking about PhantomJS & Selenium, do you have any tips for accepting by default a browser alert popup (for example security alert) and not declining it by default 🙁

  2. Hello David, thank you for this code.
    Startup Phantomjs.exe service (with PhantomJSDriver) seems to be a problem under Windows 7. There is a UrlChecker.TimeoutException that is thrown from the DriverService.start() method.

    Against by creating the web driver with RemoteWebDriver (new URL (“http://localhost:8910”) myCapabilitiesPhantomjs)); it works

  3. Thanks for fighting the Selenium’s hell, we need warriors for this mission 🙂 At BugBuster we have built the core product from the ground up with time-insensitivity in mind. Please have a look and let us know what you think. Keep up the fight! Luc

  4. Glad to see that I’m not the only one finding it very hard to use Selenium. I must say, though, that I’m quite impressed by the Protractor/angular integration. I’ve only had 1 or 2 timeout/stability problems on over 100 protractor tests, whereas I’ve had dozens on only a few tests written with the Java driver, for a multi-page, jQuery-based app.

Comments are closed.