To use FireWatir, you need to install two things: the firewatir gem and an extension to firewater called JSSH (JavaScript SHell).
There are three steps involved in installing FireWatir:
1) Install the FireWatir Gem
If you are behind a proxy/firewall, see this page on how to still use ruby gems.
Windows
gem install firewatir
Linux/Mac
sudo gem install firewatir
You may need to first update rubygems using this command:
sudo gem update --system
2) Install the JSSH Firefox Extension
The correct extension depends on your platform and your version of Firefox.
Production FireWatir
| Platform | Firefox 2.0 | Firefox 3.0 | Firefox 3.5 | Firefox 3.6 |
|---|---|---|---|---|
| Windows | install | install | install | install |
| Mac | install | install | install | install |
| Linux | install | install | install | install (Ubuntu 10.10 64bit) install |
For Windows users who are installing XPI for Firefox 3.0, make sure you have also installed "Redistributed package for VS 2005 SP1". Thanks to "Ryan Huynh" for figuring out this requirement. You can get the package from here
For Windows users who are installing XPI for Firefox 3.5 or above, you may have to install "Redistributed package for VS 2008 SP1". You can get the package from here
For Debian user who are installing XPI for Firefox 3.0 and 3.5 you may have to install xulrunner development package: sudo aptitude install xulrunner-dev.
Experimental Support for Concurrent Testing (unsupported)
In addition to the above add-ons, there is a patched extension that some people are using with a patched version of FireWatir. This version supports driving multiple browsers concurrently, using multiple profiles. It is not compatible with production FireWatir.
Find out more about this here
Advanced Users: Compiling JSSH
There are instructions on how to compile JSSH here and here and here.
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.
- Make sure that Firefox opens a new window instead of a new tab when a link is clicked.
You will need to open Firefox using acommand line argument to get FireWatir to recognize jssh. To do this, open your command prompt, or a terminal, and run:
firefox.exe -jssh
or
./firefox-bin -jssh
from the appropriate folder, depending on your platform.
4) Troubleshooting
- XPI installation failure. The downloaded theme or extension will not install
Ref: http://kb.mozillazine.org/Unable_to_install_themes_or_extensions_-_Firefox
Some web sites offer the option to download a theme or extension instead of installing it. The downloaded file will have a ".jar" or ".xpi" extension. Do not try to open these files directly. After the download is complete, drag the downloaded .jar or .xpi file icon from the desktop (or other location) and drop it onto an open Firefox "Add-ons" window ("Extensions" or "Themes" window in Firefox 1.5 and earlier).
Comments (11)
May 03, 2009
Dennis Sutch says:
I would assume that the tests can be run by downloading the source and running m...I would assume that the tests can be run by downloading the source and running mozilla_all_tests.rb from the tests directory.
Sep 08, 2009
Hippie Hacker says:
None of the above xpi's for linux appear to be 64bit. Baroquebobcat has instruc...None of the above xpi's for linux appear to be 64bit.
Baroquebobcat has instructions to completely build from scratch to include jssh, however it seems a bit of overkill.
http://blog.baroquebobcat.com/2009/01/06/jssh-firefox-ubuntu-64bit/
I wonder if it would be possible to build just the 64bit xpi's for 3.0 and 3.5 under linux/firefox.
Jan 28, 2010
gary says:
Please forgive me but I'm still having trouble installing any of this. I've been...Please forgive me but I'm still having trouble installing any of this. I've been using watir for a while in IE and now would like to install firwewatir, safariwaitr, etc but I can't even fathom out how to install them.
I installed watir 1.5.1.1164 from a gem and it was straightforward. (Ruby 1.86 from one click installer) Put the gem in c drive and then from command prompt type gem install watir, hey presto works a treat.
The latest firewatir gems etc. are compressed as tar files which when extracted contain further tar files but no gems. What do i put were as I can't figure out what should be pretty basic?
Someone, anyone, please help as I'm a big fan of ruby and don't want to bin it and strat learning something else.
Thanks in advance.
Gary
Feb 05, 2010
Moises Siles says:
Someone knows something about the jssh firefox extesion for 3.6? Thanks in adva...Someone knows something about the jssh firefox extesion for 3.6?
Thanks in advance
Feb 05, 2010
Alister Scott says:
@Moises: I don't understand your question. Please clarify and rephrase and use ...@Moises: I don't understand your question.
Please clarify and rephrase and use the Watir Google Group to ask it.
May 19, 2010
Stanley Shilov says:
I wasn't able to get the extensions available on this site to work properly so&n...I wasn't able to get the extensions available on this site to work properly so I put together a tutorial on how to compile Firefox with JSSH support for FireWatir on Ubuntu 64bit. It should work for all new versions of Firefox, up to 3.7 minefields.
Jun 12, 2010
Zenon Harley says:
I needed the xpi for Ubuntu / Firefox 3.6, so I built it and added it to the tab...I needed the xpi for Ubuntu / Firefox 3.6, so I built it and added it to the table, above. Hopefully it works for others!
For reference, my method for building it is here:
http://skythink.com/doc/building-jssh-for-watir-with-ubuntu
@Stanley: Thanks for the head start!
Jul 08, 2010
jonyamo says:
I ran into the jssh issue today trying to get Watir working on Ubuntu 10.04 x86...I ran into the jssh issue today trying to get Watir working on Ubuntu 10.04 x86_64. Before I started ripping Firefox apart I happened to come across a much easier solution… at least for me; it doesn't directly solve the problem but it gets the job done. It uses two modules, selenium-webdriver and watir-webdriver. I haven’t looked too much into the technicalities yet but it seems that selenium-webdriver provides it’s own version of the different browsers and it doesn’t depend on the embedded javascript core (which is why watir won’t run on firefox without the jssh extension). Check it out here: http://zeljkofilipin.com/2010/01/12/watir-on-webdriver/.
Jan 10, 2011
Curtis Miller says:
Hi all, I am very new at Ruby and am having an issue when trying to run my scri...Hi all,
I am very new at Ruby and am having an issue when trying to run my script using watir.
I am getting this error:
"./watir.rb:4:in `require': no such file to load -- firewatir (LoadError)
from ./watir.rb:4
from watir.rb:3:in `require'
from watir.rb:3"
Any help would be great!
Thanks!
Curtis
Jan 11, 2011
Zeljko says:
Curtis, we do not provide support via comments. For support please see http://wa...Curtis, we do not provide support via comments. For support please see http://watir.com/support/
Jan 19, 2011
nathan says:
For some reason the XPI for Linux Firefox 3.6 wasn't working for me on Ubuntu 10...For some reason the XPI for Linux Firefox 3.6 wasn't working for me on Ubuntu 10.10 64bit, so I followed Zenon's great instructions here: http://wiki.openqa.org/display/WTR/FireWatir+Installation?focusedCommentId=42861027#comment-42861027 and compiled another version, which I added to the table above.
To explain a little more, the Zenon's XPI installed fine, but it didn't work. Checking the error console usually showed an error on line 136 of nsJSShStarter.js, and sometimes it showed an error loading libjssh.so. So I think this problem is library related, specifically I'm guessing that some library was updated in Ubuntu 10.10 that prevented the binary from Zenon's extension package from loading.