Blog Home »

Selenium vs. Watir

February 19th, 2009 admin Posted in Open Source tools 4 Comments »

By Upendra Patel

Selenium and Watir are the best front end based web application testing frameworks (Open Source) at present. Both selenium and watir supports test suites in Java or Ruby and you can replay them subsequently.

Selenium has a firefox based recorder tool (Selenium IDE), that can capture browser actions and create test cases in multiple languages like Java and Ruby.

The Selenium IDE can show you Java/HTML/Perl/C#//PHP/Python/Ruby code for the recorded test case. Copy that and run as java test case with selenium apis in classpath.

In Selenium, after requests submit is done by the script, it doesn’t know how to detect the arrival of response. So, technically it waits for a specified amount of time and then assumes the page has been loaded with response content. In test suites, it comes like this - selenium.waitForPageToLoad(”30000″); defining this wait period becomes the script writer’s (tester) responsibility.

If you have a process to run test cases on multiple environments, it can worsen the scenario quickly.
Watir, on the other hand works embedded within the browser. This means, it can detect when the server response comes back. Hence the tester can focus on what the response value should be rather figuring out what the approximate wait period on each page should be. Watir is also considered to be better for Ajax based testing.

On the other side, Watir doesn’t have a mature recorder tool. Watir is a Ruby framework therefore knowledge of Ruby is mandatory for using Watir.

Selenium uses a unique mechanism for driving browsers. Selenium’s automation engine is written in JavaScript and runs inside a browser. The engine, called a browser bot, is embedded in a page that accesses the application under test in a separate frame.

Watir is a Ruby library that wraps the COM interface to Internet Explorer. COM is a long-standing. This allows access to the Document Object Model (DOM) so it doesn’t matter where on the page an object exists, what matters is how you identify it (id, name, title, etc).

A brief Comparison between Watir and Selenium

AddThis Social Bookmark Button


Home   |   About Us  |   QA Library   |   Learning Center   |   FAQs   |   Career Center  |   Link Exchange   |   Contact Us
Copyright © QACampus.com. All Rights Reserved.
Powered By : codeplatter
Vision / Mission CresTech Connection Management Team
QACampus Courses ClassRoom Training Live Projects E-courses
Blog Forum QA Library
Career Center Hot Job Upload Resume