These are some observations and issues i noticed using Watir. I am automating the test of a dot net application under IE 7.

This post is still being updated ...

  1. Watir is relatively slow if compared to Selenium. Even when you use ie.speed=:zippy, it's not very practical and components like phone numbers fields like the one in the picture below will crash. Because what ie.speed=:zippy does is actually using the method value= instead of set() and i had some fields crashed because of that. So i didn't useie.speed=:zippy and instead i used ie.speed=:fast and value= only with text_field. This improved the speed. But still the playback is slow relatively. Personally i think the reason why Watir is slow because ruby is a fancy programming language!



  2. Watir speed varied a lot according to various network topologies. The speed is changed by a factor of 10 slower or faster. So you have to be careful and make sure that Watir server and the web application under test are neighboring. You can arrange that with your network admin. Of course this is the rule for all automation tools.
  3. I managed to connect my watir script to a datapool. I used ruby/mySQL driver to pull the data from a localhost database, but again the problem is the slow speed when fetching data from the pool. I am not sure if i can consider this a problem in Watir, since it's the case in almost any automation tool i have used. I also managed to pull the datapool from MS Sql Server using Sequel
  4. When accessing dynamic menus, i had to use some workarounds. For example the following code is used to click a dynamic menu element. The menu is basically a table that pops when the mouse hovers on its title:

    ie.image(:src, 'path_to_the_menu_tile_image/loanapp_mnu.gif').fire_event("onmouseover")
    tempTable1 = ie.table(:id, 'Table_ID')
    (tempTable1[8][1]).click()

    This code simulates the user action of hovering on the menu title and clicking on the specified menu element.

    I am not sure if this is the best way to do this. Any ideas?

  5. Watir has no reporting facilities as far as i know. So we pumped our testing results dynamically to MS SQL database while the script is running. And eventually, a nice grid will display the results in a user friendly way.

Please share your ideas if you have any solution for the above issues