Dashboard > Watir > ... > FireWatir > FireWatir Example Script
Watir Log In View a printable version of the current page.
FireWatir Example Script
Added by Alister Scott, last edited by Alister Scott on Aug 16, 2008
Labels: 
(None)

This is a simple example script. It opens yahoo mail and signs-in using the credentials you have given and then signs-out.

#Include the FireWatir file. 
require 'firewatir'

#include the FireWatir Module.
include FireWatir

ff=Firefox.new
#Open yahoo mail. 
ff.goto("http://mail.yahoo.com")

#Put your user name. 
ff.text_field(:name,"login").set("User_Name")

#Put your password.
ff.text_field(:name,"passwd").set("Password")

#Click Sign In button.
ff.button(:value,"Sign In").click

#Click Sign Out button.
ff.link(:text, "Sign Out").click

#Close the browser.
ff.close

Site running on a free Atlassian Confluence Community License granted to OpenQA. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators