Fork me on GitHub

Wednesday, January 13, 2010

ChromeWatir + Watir-WebDriver Update [Important]

Interesting development in Watir world but not a completely unanticipated one. I started playing around with using WebDriver as platform for Watir in the form of FireDriver and ChromeWatir.

Yesterday Jarib has released a Watir abstraction on top of WebDriver. I am planning to move the effort of working on ChromeDriver to Watir-WebDriver which has ChromeDriver in it.

Installation of Watir-WebDriver

> sudo gem install selenium-webdriver
> git clone git://github.com/saivenkat/watir-webdriver.git

Example code in watir-webdriver (ChromeDriver)

require "watir-webdriver"
browser = Watir::Browser.new(:chrome)
browser.goto "http://www.google.com"
browser.text_field(:name, "q").set "Watir"
browser.button(:name, "btnG").click

The code is same as Watir except the driver changes internally.
The repo is in http://github.com/saivenkat/watir-webdriver. Feel free to fork and enjoy...

No comments: