K
Kate Bond
Hi, just wondering if anybody can tell me what's wrong with this code:
# the Watir gem
require 'rubygems'
# the Watir controller
require 'watir'
# set variables
validator = "http://validator.w3.org/"
url1 = "http://www.google.com"
url2 = "http://pingmag.jp/2008/01/17/chimpom/"
url3 = "http://www.google.com/"
# open the IE browser
ie = Watir::IE.new
puts "Beginning validation"
ie.goto validator
ie.text_fieldid, "uri").set(url1)
puts "Checking URL #1....."
ie.buttonvalue, "Check").click
if ie.text.include? "This Page Is Valid"
puts "URL#1 validates!"
else
"URL#1 does not validate!"
end
ie.goto validator
ie.text_fieldid, "uri").set(url2)
puts "Checking URL #2....."
ie.buttonvalue, "Check").click
if ie.text.include? "This Page Is Valid"
puts "URL#2 validates!"
else
"URL #2 does not validate!"
end
ie.goto validator
ie.text_fieldid, "uri").set(url3)
puts "Checking URL #3....."
ie.buttonvalue, "Check").click
if ie.text.include? "This Page Is Valid"
puts "URL#3 validates!"
else
"URL #3 does not validate!"
end
puts "End of validation"
I get results for URL's #2 and #3, only the 'Checking URL....' and 'End
of validation' messages.
# the Watir gem
require 'rubygems'
# the Watir controller
require 'watir'
# set variables
validator = "http://validator.w3.org/"
url1 = "http://www.google.com"
url2 = "http://pingmag.jp/2008/01/17/chimpom/"
url3 = "http://www.google.com/"
# open the IE browser
ie = Watir::IE.new
puts "Beginning validation"
ie.goto validator
ie.text_fieldid, "uri").set(url1)
puts "Checking URL #1....."
ie.buttonvalue, "Check").click
if ie.text.include? "This Page Is Valid"
puts "URL#1 validates!"
else
"URL#1 does not validate!"
end
ie.goto validator
ie.text_fieldid, "uri").set(url2)
puts "Checking URL #2....."
ie.buttonvalue, "Check").click
if ie.text.include? "This Page Is Valid"
puts "URL#2 validates!"
else
"URL #2 does not validate!"
end
ie.goto validator
ie.text_fieldid, "uri").set(url3)
puts "Checking URL #3....."
ie.buttonvalue, "Check").click
if ie.text.include? "This Page Is Valid"
puts "URL#3 validates!"
else
"URL #3 does not validate!"
end
puts "End of validation"
I get results for URL's #2 and #3, only the 'Checking URL....' and 'End
of validation' messages.