The following code executes without problems as a script but
produces exception when executed statement by statement in IRB:
require 'rubygems' require 'funfx/browser/firewatir' browser =
FireWatir::Firefox.new browser.goto
"http://localhost:9851/index.html" flex =
browser.flex_app('DemoAppId', 'DemoAppName')
Related gems: funfx-0.2.0, firewatir-1.2.0.
IRB output: irb(main):001:0> require 'rubygems' => false
irb(main):002:0> require 'funfx/browser/firewatir' => true
irb(main):003:0> browser = FireWatir::Firefox.new PROFILE:
Starting Firefox using the executable : C:\Program Files\Mozilla
Firefox\firefox.exe Waiting for 2 seconds for Firefox to get
started. => #<FireWatir::Firefox:0x2dfb298
@error_checkers=[], @window_title="", @window_url="about:blank",
@t=#<Thread:0x2dc1b10 dead>> irb(main):004:0>
browser.goto "http://localhost:9851/index.html" =>
#<FireWatir::Firefox:0x2dfb298 @error_checkers=[],
@window_title="", @window_url="http://localhost:9851/index.html",
@t=#<Thread:0x2dc1b10 dead>> irb(main):005:0> flex =
browser.flex_app('DemoAppId', 'DemoAppName')
FireWatir::Exception::UnknownObjectException: Unable to locate
object, using and
from d:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.2.0/./
MozillaBaseElement.rb:866:in assert_exists'
from d:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.2.0/./
MozillaBaseElement.rb:648:in inspect'
from d:/ruby/lib/ruby/1.8/irb.rb:298:in `output_value'
from d:/ruby/lib/ruby/1.8/irb.rb:151:in `eval_input'
from d:/ruby/lib/ruby/1.8/irb.rb:259:in `signal_status'
from d:/ruby/lib/ruby/1.8/irb.rb:147:in `eval_input'
from d:/ruby/lib/ruby/1.8/irb.rb:146:in `eval_input'
from d:/ruby/lib/ruby/1.8/irb.rb:70:in `start'
from d:/ruby/lib/ruby/1.8/irb.rb:69:in `catch'
from d:/ruby/lib/ruby/1.8/irb.rb:69:in `start'
from d:/ruby/bin/irb.bat:15