Dip Me in the Watir
Watir and Selenium Many Watir users report that they are able to quickly get up and running and productive with Watir even if they don’t know Ruby. The public reception of Selenium is that it’s a cool idea that shows promise.
That was exactly my experience. I struggled with SeleniumRC for several hours before giving up and moving to Watir; I was up and running in a few minutes.
It seems to me that Selenium could be modified to export Watir scripts. The Ruby export is close enough that it’s just about a regex away, once you get over the setup code:
The Selenium way:
pre. selenium = Selenium::SeleneseInterpreter.new("localhost", 4444, "*firefox", "http://localhost:4444", 10000);
selenium.start
selenium.set_context("test_homepage_index_listingpage")
selenium.open “/”
selenium.click "link=Florida Keys"
selenium.wait_for_page_to_load “30000”
@selenium.click "//area[27]"
@selenium.wait_for_page_to_load “30000”
The Watir way:
pre.
require “watir”
test_site = “http://www.example.com”
ie = Watir::IE.new
ie.goto test_site
ie.link(:text,“Florida Keys”).click
ie.area(:xpath, "//area[27]").click
— Gordon Weakliem
Comment
Commenting is closed for this article.
If interested in developing web automation in C# or VB.NET, check out http://www.InCisif.net
— ftorres · 30 January 2008, 20:50 · #