Selenium And Watir
1
TDD is an important practice for applying Agile process; some Agile professionals even restrict the practices of it into 2 main practices: Applying the TDD and getting the customer involved in almost all the project's life cycle.
TDD can't be applied without applying automated testing in the project cycle. Here, I'll present 2 automated testing tools for testing:
Selenium is one of the famous tools for automated testing; the tester can use any of its operating modes, of which there are actually 3:
- Selenium IDE: is a Firefox addon that records clicks, typing, and other actions to make a test which you can play back in the browser. If you use Selenium IDE, you won't have to install anything on the server.
- Selenium Remote Control(RC): runs your tests in multiple browsers and platforms. Tweak your tests in your preferred language.
- Selenium Grid: extends Selenium RC to distribute your tests across multiple servers, saving your time by running tests in parallel.
Selenium uses Selenese, its own scripting language to write tests. It consists of some simple commands: "open", "type", "click" are some examples of these commands.
As you have noticed, the commands are very simple and easy to learn, but it's still an additional language . Recently, new drivers have been released that allow the tester to write tests in Ruby or Java. Dot Net and Python are still in development.
For a beginner, I recommend to use the recorder first to know more about Selenese then try to edit in the test file, then start writing your own tests scripts. The below screen shot is for Selenium IDE.

Watir is another famous automatic testing tool. It has a recorder just as Selenium to record tests, but this one doesn't not have its own scripting language; it uses Ruby instead. The name is actuallyt an acronym for "Web Application Testing in Ruby".
Please have a look at the below screen shot to see the result of a quick recording of a test script to open Google and search for a word:

I think that the main advantage of both Selenium and Watir is the ability to run directly from inside the the browser; for Selenium this is because the automation engine is written in javascript, which is supported by browsers. This way you don't have to have a separate machine to run automated tests.
The biggest complaint with Watir regards its being limited to IE and Windows, but currently it's under development to let it support both Firefox and Saffari. For Selenium, the main problem is the need for installing it with the application under test in the application test server.
Written By:
Heba Hosny
Comments
Post a Comment
eSpace podcast Prodcast
Archive
Latest Comments
- SpectraMind Commented on Egypt Wins UK's National Outsourcing Association Award
- Rofaida Awad Commented on Go Egypt Go!
- Different Mike Commented on Only idiots change their iPhone root password!
- Mike Commented on Only idiots change their iPhone root password!
- smile Commented on Only idiots change their iPhone root password!

