Removing @container.wait is definitely not going to solve the problem since there could be some events which should wait. You could try to add some sleep statements before fire_event and also provide us with the stack where that timeout exactly occurs.
Jarmo On Mon, Nov 8, 2010 at 8:11 AM, Alister Scott <alister.sc...@gmail.com> wrote: > Hi, > > I am testing an AJAX heavy web app which uses 'onchange' events on text > fields. Approx one tenth of the time, when I fire an onchange event using > fire_event, it causes Watir to timeout for 5 minutes. > > For example: > > When I set "Letter" to "Blah" # > features/step_definitions/input_text_steps.rb:7 > > execution expired (Timeout::Error) > > C:/Sandbox/Tools/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/timeout.rb:64:in > `wait' > ./features/support/../../lib/blah/form.rb:38:in `[]=' > ./features/step_definitions/input_text_steps.rb:8:in `/^I set "([^"]*)" > to "([^"]*)"$/' > features\sociability\blah\blah.feature:45:in `When I set "Letter" to > "blah"' > > I traced this down the the element.rb file, and have monkey patched this > class to remove the @container.wait, but I was wondering if there is a > better way? As it only happens about 10% of the time, it makes it hard to > debug, but removing the wait from fire_event seems to have resolved the > issue. I thought about catching the Timeout::Error, but I don't want my > script to freeze for 5 minutes at a time. > > Any help would be appreciated. > > def fire_event(event) > assert_exists > assert_enabled > > highlight(:set) > ole_object.fireEvent(event) > #...@container.wait > highlight(:clear) > end > > Cheers, > > Alister > > _______________________________________________ > Wtr-development mailing list > Wtr-development@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > _______________________________________________ Wtr-development mailing list Wtr-development@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development