1) install the firewatir gem
Gem install firewatir
2) install the jssh Firefox extension
Firefox 3.6 on Windows:Http://wiki.openqa.org/download/attachments/13893658/jssh-3.6-WINNT.xpi? Version = 1 & modificationdate = 1264489925906
3) Ensure Firefox settings are correct
Certain Firefox settings need to be changed to ensure firewatir functions correctly. These instructions can be followed to get the Firefox # attach command to work.
- Make sure that pop ups are allowed in Firefox. You can allow all popups, or only for certain sites that you are testing. (option-> content)
- Make sure that Firefox opens a new window instead of a new tab when a link is clicked. (option-> tabs)
4) you will needOpen Firefox using a command line argumentTo get firewatir to recognize jssh. To do this, open your command prompt, or a terminal, and run:
Firefox.exe-jssh
5) firewatir example script
# Include the firewatir file. require 'firewatir' FF = firewatir: Firefox. new # Open Yahoo Mail. ff. goto ("http://mail.yahoo.com") # Put your user name. ff. text_field (: name, "login "). set ("user_name") # Put your password. ff. text_field (: name, "passwd "). set ("password") # click sign in button. ff. button (: value, "sign in "). click # click sign out button. ff. link (: text, "sign out "). click # Close the browser. ff. close