# Require section
require "rubygems"
require "watir"
#
puts "Browser is running..."
END {
puts "Closing browser..."
}
BEGIN {
puts "Starting browser..."
}
#
#
Given /^that I have gone to the Login page at "(.*)"$/ do |item|
@browser = Watir::Browser.start(item)
lnk_found = 0
@browser.links.each do |lnk|
if lnk.id.to_s.matches("overridelink")
lnk_found += 1
end
end
if lnk_found > 0
@browser.link(:id, "overridelink").click
end
@browser.maximize
end
#
#
When /^I add "(.*)" to the Username$/ do |item|
@browser.text_field(:name, "loginName").set(item)
end
#
#
When /^I add "(.*)" to the Password$/ do |item|
@browser.text_field(:name, "passwd").set(item)
end
#
#
Then /^"(.*)" should be mentioned on the page$/ do |item|
if @browser.text.include?(item)
# puts "TEST PASSED. FOUND >#{item}<"
else
puts "*** TEST FAILED ***. >#{item}< was not found."
end
end
#
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.