Using WebDriver with CSharp

You can read my previous post if you’re interested in the background to this post. What follows is a step-by-step guide for using WebDriver from C# test code.


What you’ll need:

  • IKVM.NET.  I used version and the download was called
  • WebDriver “all”.  The download will be called something like

Continue reading

Moving away from Selenium

Recently I’ve spent a lot of time developing MVC.NET based web apps. The automated functional tests for these web apps have all been written using Selenium, with the tests written in C#  and organized as NUnit test fixtures.

Whilst I found Selenium to be a good tool, I ran into some serious problems with it:

  1. Some of my Selenium based functional tests would fail approximately 10% of the time when they were run against Firefox.   Switching the exact same tests to using Internet Explorer (still with Selenium) resulted in the tests returning to 100% stability.  This meant abandoning automated functional testing with Firefox in favour of using IE.
  2. Slow performance in Internet Explorer (mitigated to some extent by switching the XPath engine Selenium uses with it).  IE just isn’t a fast browser when used with Selenium.
  3. Many of Seleniums operations are non-blocking (i.e. asynchronous).  This means Selenium doesn’t wait for those operations to complete before allowing a test to continue.  For example opening a new webpage in Selenium is a non-blocking operation; Selenium will happily load a page and then (via the next line in the functional test) attempt to click a button on the page when the button hasn’t even loaded yet.

Looking round for an alternative to Selenium, there was one obvious replacement: WebDriver.  Continue reading