Fork me on GitHub

Sunday, April 26, 2009

FireDriver => FireWatir + WebDriver Experiment

I think I have become the evil scientist in the Watir world creating all these experiments :). Well everyone knows the story. FireWatir is great especially after the integration with Watir and getting the same API. There are people out there working busy to iron out the differences in API and making things better. But the FireWatir world is not all perfect. The JSSH which FireWatir depends on to drive FireWatir by injecting JavaScript is a legacy code or more accurately an orphaned code (No maintainer). The code base is a black box (At least for me. Not sure for other but Angrez will know the internals). We know how to use it but any defects on its front has practically no owner. And there is no scarcity for defects also. The interface with firefor is also weak. Enough ranting. I think you get the picture. To make FireWatir better we must move away from JSSH.

Thus this experiment started, an effort to save FireWatir from Jssh. Looking at the options, I really like the way WebDriver works with the browsers through native code layer to automate them. I think Bret and Charley will agree with me on this. So with Simon, Bret and Charley's help I set out to do a spike on using WebDriver's Firefox driver to drive Firefox from Ruby to use it with Watir.

I didn't want to consume WebDriver jar from JRuby and wrap it up with Watir API as this will not help the people who use native Ruby. So I am actually using the JavaScript extension which is the core of the WebDriver's Firefox driver. This extension sits inside Firefox and drives it according to the commands which it gets over the wire in a JSON based protocol. If you need to know more details about the implementation, please check out the code in GitHub FireDriver project. There are a few things like setup the extension and install the gems which you need to do for now (They will be automated soon). The way to do this is in the Wiki. Again any help needed in this, please let me know.

The solution is not perfect yet. It is an experiment. There are synchronization problems. The API is very small. I am working on this to make it evolve better. If you wish to contribute please fork the repo and start working on it right away. Thats the GIT way :).

Thank you Jijesh for helping me in this. Thank you Bret, Charley and Simon for supporting me.

3 comments:

Charley Baker said...

Truly awesome. Thanks for taking the lead to actually do a spike on this; in addition to the other problems you mentioned about the JSSH plugin, it also needs to be recompiled for each FF browser/OS combination. That quickly becomes a maintenance nightmare.

With your initial work, the common Watir tests, and putting the code on Github, we should be in good shape to move this forward as the FireWatir base standard soon.

Kudos. :)

Sai Venkatakrishnan said...

Thank you Charley... Yes recompiling JSSH is another nightmare. I remember Jasnow trying to do that for opensolaris and nobody was able to help him to do this. We need a platform independent powerful way to drive Firefox and WebDriver's Firefox extension offers us that.

Ċ½eljko Filipin said...

Sai, finally somebody did a first step in moving away from jssh, and who else but you?! :)

(Link to Bret's twitter account is broken.)