Skip to main content

Jun 17, 2014 - 3 minute read - Selenium Simplified Blog WebDriver

A quick WebDriver 2.42.2 retrospective

I spent a fair few hours working through all the tests and examples on my Selenium WebDriver Course to check compatibility with WebDriver 2.42.2 and the most recent browsers.

I used…

  • Chrome Version 35.0.1916.153 m
  • IE Version 11.0.9600.17126
  • Firefox version 30.0
  • HTMLUnit 2.14 (included with WebDriver 2.42.2)

Let’s get opera out of the way quickly - since operadriver only supports Opera up to version 12.16, and the current version is 22 - I didn’t run the tests against this. Pity, since Opera still feels like a fast browser.

And let’s get IE out of the way quickly, but not dismiss it. IE 11 still awaits the official driver from Microsoft, so we should expect the current driver to have issues with it. There were a whole bunch of tests I was able to reinstate against IE because the driver functionality has moved on since I last checked it. But sadly, the speed of sendtext kills tests in IE11. I didn’t spend a lot of time debugging the tests against IE 11 - hopefully Microsoft will get an official driver out soon.

Pity, as the IE driver has improved a lot for 8,9, and 10. Previously I had failing tests for user interactions, alerts, input alerts, and these no longer occur.

HTMLUnit driver impressed me the most. I haven’t given it much love and attention over the years, but since I saw that WebDriver has recently upgraded the version of HTMLUnit that it uses, I thought I’d give it a shot. Out of my basic “All” browsers test suite, it only failed 12 tests, (out of 155) so I’m going to spend a bit more time investigating the limits of HTMLUnit driver. I was very impressed. Remember, start HTMLunitDriver with ‘true’ to get the JavaScript support.

Firefox trundled along happily with no changes to my codebase to keep the tests running due to the driver, just one change to the codebase and it was my fault:

  • I found a bug in one of my tests because Firefox was no longer tolerant of my mistakes
    • I had left a release in after a drag and drop, and now I receive an exception about “can’t release button when not clicked”, so I fixed my code
    • actions.dragAndDrop(draggable2,droppable1).release().perform();
    • don’t do that, do this
    • actions.dragAndDrop(draggable2,droppable1).perform();

Chrome required a few changes:

  • I had to deal with the “-ignore-certificate-errors” reporting by adding a chrome option when starting the driver “options.addArguments(“test-type”);”
  • Chrome seems to create rogue cookies when you add a cookie with the domain in it (I raised this as an issue 7499 (now moved to ChromeDriver issue 824) but I suspect most people will never encounter this issue). And the workaround - just don’t add the domain, the cookie will still be created fine.
  • Chrome now supports submitting forms with a keypress on the submit button (which it didn’t last time I checked) so I re-enabled that test for Chrome

Always remember to double check issues with your automation manually kids.

I found an issue with Chrome - that had nothing to do with WebDriver.

One of my tests uses sendkeys to select items from a dropdown by typing in the text of the dropdown option. This has previously worked, and still works on Firefox. But it doesn’t work on Chrome through WebDriver. And it doesn’t work on Chrome when I repeat the test manually, so I’m putting this down to a Chrome nuance, rather than a WebDriver nuance.

I also found an interesting side-effect of getAttribute, that I’ll blog about separately.

You will need a Github account to comment. Or you can contact me with your comment.

I reserve the right to delete spam comments e.g. if your comment adds no value and its purpose is simply to create a backlink to another site offering training, or courses, etc.