This article will reveal you the secret of Watir/Watin.
As popular as Selenium, Watir/Watin is another open source tool which can be used to conduct automated testing on different browsers. To support multiple browsers, drivers of different browsers have been developed by Watir & Watin. And for firefox, JSSH is employed to fulfill the purpose of manipulating the browser.
What is JSSH?
The source code of JSSH is available at http://code.google.com/p/firewatir/source/browse/trunk/?r=131#trunk/Installation
An “Hello JSSH” example – Google.com
- You need to install the JSSH extension first. Click here for detail.
- Start the firefox with JSSH support.
- Telnet to the JSSH. The default port is 9997.
telnet localhost 9997
var w0 = getWindows();
var browser = w0.getBrowser();
var doc = browser.contentDocument;
var input = doc.getElementsByName(“q”);
var button = doc.getElementsByName(“btnG”);
input.value = “hello JSSH”;