|
Red Squirrel Reflections
Dave Hoover explores the psychology of software development
|
|
Mon, 24 Jul 2006SafariWatir now offers feedback when you try to access an element that doesn't exist...
browser = Watir::Safari.start("http://google.com/")
browser.button(:name, "foo").click
Watir::Exception::UnknownObjectException: Unable to locate Button element with name of foo.
from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.1.1/./safariwatir/scripter.rb:243:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.1.1/./safariwatir/scripter.rb:68:in `highlight'
from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.1.1/./safariwatir.rb:10:in `click'
from (irb):4
That's an important step forward, but I added something else this weekend just for fun.
Tell me, Mr. Anderson, what good is a phone call if you're unable to speak? You can now interrogate any SafariWatir element ... and it will speak. After you gem install safariwatir, turn up your speakers and try this...
browser = Watir::Safari.start("http://redsquirrel.com/cgi-bin/dave/projects/watir/safari.watir.0.1.1.html")
browser.span(:id, "matrix_quote").speak
I'm not sure what a feature like this is good for, but I couldn't resist.
|