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'
ff=FireWatir::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
Comments (2)
Mar 17, 2009
Kurt Liu says:
On Ubuntu (8.10), I run into this problem when I try to require firewatir: irb...On Ubuntu (8.10), I run into this problem when I try to require firewatir:
The solution seems to be to add this line before requiring firewatir:
require "rubygems"Then you should have no more trouble.
Found this from:
http://groups.google.com/group/watir-general/browse_thread/thread/36eb143d853d00aa
Mar 23, 2009
dennisi says:
@Kurt, I had the same problem. But I figured out that you don't have to include...@Kurt,
I had the same problem. But I figured out that you don't have to include " require 'rubygems' " if you have it as an environment variable.
The installer is supposed to do this, but it didn't for me when I followed the installation instructions on Watir's homepage.
Add the following to your environment variables...
Variable: RUBYOPTS
Value: -rubygems