Selenium and Watir, as we know, are the two most popular open-source testing frameworks. The next big thing is WebDriver, which is now merged with Selenium 2. Thanks Jari Bakken (who is also the creator of Celerity), we have Ruby bindings for Selenium 2 and even Watir wrapper of it: watir-webdriver, which some might refer it as Watir 2.0. With watir-webdriver, users can pretty much reuse existing Watir scripts, with minor changes.
What are the benefits of using watir-webdriver comparing existing Watir 1.6.5?
- Run same test scripts in IE, Firefox, Google Chrome and HTMLUnit (headless)
- No JSSH plugin required for running tests in Firefox
- Synergy of combination of Selenium and Watir
In last appearance at Watir Podcast, I said future TestWise versions will support WebDriver. Now you can try web-driver in IDE!
- Download TestWise-2.0b1-setup.exe and install
- In TestWise, open sample project c:\program files\testwise\samples\demo\demo.tpr (if you are using TestWise first, it shall be pre-loaded)
- Select the first test script file (left mouse click the file name on the left): ajax_rwebspec_spec.rb,
choose your browser (IE, Firefox or Chrome), then run it.
Our initial impression with Watir-WebDriver is good and very promising, with a few issues:
- Can't reuse existing browser window, has to start up a new one
- Test execution is slower than Watir 1.6
- Opening browser operation seems quite CPU intensive
Please note that both Selenium 2 and TestWise2 are at early development stage, so please use Watir 1.6.5 and TestWise 1.9 for production use.