JSSh for Firefox on Linux (because Firewatir loves it)

It goes like this: Firewatir, the Firefox port of WATIR, depends on JSSh. And JSSh does not install & run nicely on Linux. Clear ?
Annoyed by this situation, I looked what’s the problem with this JSSh. To make the story short, success – downlaod the working JSSh for Linux here.
Update 2007-04-11: modified to work also with FF 1.5.3+

Oh, by the way, JSSh stands for JavaScript Shell and it allows you remotely manipulate Firefox remotely. Firewatir gives you a higher-level toolkit for “Web Application Testing in Ruby” (of course not Web scraping ;>>> ). Talking about it let me show how to install the whole thing:

(0. I would recommand to create a dedicated Firefox profile run Firefox in a dedicated profile firefox -ProfileManager)

1. Downlaod and install JSSh extension to Firefox and restart it.

2. Start Firefox:
firefox -P testyard -jssh

The JSSh should be up, listening on port 9997 (note: consider security issues). You should be able to communicate with Firefox via telnet. For example:

>telnet localhost 9997
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to the Mozilla JavaScript Shell!
> 1+1
2
> help()
....
> exit()

3. Dowload firewatir (you have to do it from its homepage, it is not on rubyforge yet). Use the mswin32 version, although you are on Linux. Install:
sudo gem install firewatir-1.0.1-mswin32.gem

3. Get to the real ruby test. For example:

require 'rubygems'
require 'firewatir'
include FireWatir

ff=Firefox.new
ff.goto("http://www.google.com/ncr")
ff.text_field(:name,"q").set("ruby")
ff.button(:value,"Google Search").click
puts ff.element_by_xpath("//a[@class='l']").text
ff.close

PS: For those interested in what did I fix: I took one of the latest builds from Dave, repackaged it so that it installs “properly” – as an extension of “21st century” – and added the config GUI shipped originally with the JSSh. It was tested with FF 2.0.0.1 on Ubuntu (Eft), Kubuntu, Gentoo. Update: tested also on FF 1.5(.0.7)

11 thoughts on “JSSh for Firefox on Linux (because Firewatir loves it)”

  1. I want jssh for firefox3.0 in linux please help me

    waiting for your positive response…………………..

  2. Is there any way to install this on debian?

    because IceWeasel hates it

    “JSSh 0.1 could not be installed because it is not compatible with Iceweasel 3.0.7.”

  3. I got the same problem with @Clive.

    Jssh 0.1 is not compatible with Firefox 3.0.8

    Is there a high version of Jssh ?

  4. You can download the .xpi and unzip it if you change the file extension to .zip

    Then you can modify it and change its version compatibility settings to work with other versions and zip it back up (dont forget to change the extension again)….

  5. This does not work on Linux with Firefox 4.0.1 Any thought on providing support for that?

Leave a Reply

Your email address will not be published. Required fields are marked *