Thursday, January 20, 2011

How to get Watir to return actual HTM, when site is redirecting??

Web Application Testing in Ruby: Iframe in Watir

ie = Watir::IE.new
ie.goto "http://www.apple.com/safari/download"

ie.checkbox(:name, "21.1.9.12.3.1.3.0").clear
Which returns an UnkownObjectException. Same with trying to click the submit button.

Using firebug I can find the checkbox fine, that's how I found the :name. So I next redirected the HTML output from Watir into a file for inspection,

myfile = File.new("safaridebug.html", "w+")
myfile.puts ie.html
myfile.close

No comments:

Post a Comment