0

I installed watir gem in my system through

gem install watir

after that i Install the JSSH Firefox Extension.

My question how to enable the JSSH in firefox and how to use this for testing.

Thanks in advance

smathy
  • 26,283
  • 5
  • 48
  • 68
vinothini
  • 2,606
  • 4
  • 27
  • 42

2 Answers2

0

You can run GUI tests in FireFox using watir-webdriver

require "watir-webdriver"

browser = Watir::Browser.new :ff
browser.goto("http://www.google.co.in/")
browser.text_field(:name => "q").set "spritle.com"
browser.button(:name => 'btnG').click

Also, for some reason, the script could not find the firefox.exe binary on my machine so I had to add the following after require "watir-webdriver"

Selenium::WebDriver::Firefox::Binary.path='C:\Program Files\Mozilla Firefox\firefox.exe'
Patrick McDonald
  • 64,141
  • 14
  • 108
  • 120
0

Watir is a browser based web app front end testing tool.

On Windows platform, by default, web tests are run in Internet Explorer.

The main disadvantage to watir is that it only works on windows with IE.

The following will help to run sample auto test.

Save the following code in sample.rb file

require 'rubygems'
require 'watir'

browser = Watir::Browser.new
browser.goto("http://www.google.co.in/")
browser.text_field(:name => "q").set "spritle.com"
browser.button(:name => 'btnG').click

Run this file command prompt ruby sample.rb -- this command will help to run this file through command prompt

This above code will automatically open the google page and type 'spritle.com' in the text field and click the search button and then show the searching result. Finally will close the browser. (Note: This will open the Internet Explorer browser only)

For more information refer the following links:

smathy
  • 26,283
  • 5
  • 48
  • 68
vinothini
  • 2,606
  • 4
  • 27
  • 42