We’re testing. This script below will go through the list of url’s, and
on each url, write out the results of the script to a file. These
results are a) the last 3 digits of the url string
b) the 1st href on the page
c) the 3rd href on the page
a,b,c are seperated by a tab. each url result array is on a separate
We run the following ruby-watir test script
browser = Watir::Browser.new
outfile = File.new(“test.txt”, “a”)
ruby throws an exception
Watir::Exception::UnknownObjectException, since the 1st or 3rd link
we used “sleep 4” to slow down the script, but would rather have the
test run as fast as it can.
since I am a newbie to ruby, my exception handling block code attempts
aren’t working - so my syntax is off. I’ve gone through more than a few
hours of trying various ways of handling the exception with ‘rescue
Exception => e’
The exception handling should simply put an “unknown” as the values for
the missing links, and then go to the next url in the array.
This is our first ruby attempt. On another note, we landed on
ruby/watir/hpricot because we didn’t locate any testing tools that will
run in FreeBSD’s command line. This test script requires the browser to
Does anyone know of a nix solution to testing instead?