No description, website, or topics provided.
Ruby Gherkin
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Test Framework Comparison: Selenium2, Watir, Watir-WebDriver and RWebSpec

If you are undecided on choosing which test frameworks for your project: Watir or Selenium-WebDriver, the you might find this useful. Here you can find folders with test scripts in four syntax variations,

  • RWebSpec on Watir
  • Watir with RSpec
  • Watir with Cucumber
  • RWebSpec on Selenium2
  • Selenium2 with RSpec
  • Selenium2 with Cucumber
  • Watir-WebDriver with RSpec
  • Watir-WebDriver with Cucumber

All eight test projects can be opened and run in TestWise 3, you can easily to try out and compare yourself.

Behaviour Driven Development Framework: RSpec

RSpec is a Behaviour-Driven Development framework in Ruby, it helps on executable documentation in Acceptance Test-Driven. In simple words, you can write acceptance UI tests in RSpec, and it will be the living specification.

Selenium-WebDriver (Selenium 2) vs Watir vs Watir-WebDriver

Next major version of Selenium-WebDriver (also known as webdriver) is released in July 2011, it is supported in multiple programming languages. Here we only compares its Ruby version (a popular and concise scripting language, perfect for test scripts) against Watir (Web application testing in Ruby)

If you need to run Test against Firefox or Chrome, then Selenium-WebDriver is the only choice. For IE, Watir is more mature and more stable IMO. Watir-WebDriver is is wrapper of Selenium-WebDriver in Watir syntax.

RWebSpec vs Watir vs Selenium-WebDriver

RWebSpec provides an high level abstract of testing syntax on top of Watir or Selenium-WebDriver, i.e., if you develop test in RWebSpec, it will be easy to switch between Watir and Selenium-WebDriver. Besides, without of loss of flexibility, you can use native Watir with RWebSpec or Selenium-WebDriver with RWebSpec.

Also RWebSpec provides other benefits:

  • Built-in Pages-objects support
    expect_page SignUpPage
  • More intuitive test steps, no need of reference to browser object.

    enter_text(“user”, “testwise”)

    Watir version:
    browser.text_field(:name, “user”).set(“testwise”)
    browser.button(:value, “Login”).click

  • Common test helper methods
    try(10) { click_button(“Next” } # for AJAX testing, try click the button upto 10 seconds
    fail_safe { logout } # if already logged out, it’s OK, don’t throw error
  • Test data generator
    random_number(100, 999) # generate a number bigger than 100 but less than  999
    random_string_in([“Australia”, “USA”])
  • IDE Support in TestWise, can see current line under execution highlighted