Reputation: 991
I'm using Firefox 13 and Watir-webdriver on windows via Ruby 1.9.2 and porting some code that worked previously in Watir in IE over to Watir-webdriver to use with Firefox and I'm having some strange behaviour with click on various sites.
When I ask Watir to click on a button, or a link, it seems to not recognise the event has fired even though the page reload is taking place.
puts "Clicking button"
browser.button(:id,'search_button').click
puts "Button clicked"
When the above script runs I see the first output, but not the second - although the click has occured as the page reloads, the script seems to continue to run as far as the browser is concerned however the second time the loop hits this action, neither output is displayed yet again - the click occurs.
When I add when_present.click the click happens, but then the script times out after 30 seconds as it's still waiting for the element on that line to be called (the click has happened in terms of the browser but it looks like it doesn't recognise it)
I've tried updated the gems, removed gems that may have been conflicting and tried changing Firefox version from 13 to 7 but the same behavior.
Upvotes: 0
Views: 871
Reputation: 3685
Disable native events in Firefox which are enabled by default (on Windows)
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = false
Watir::Browser.new WEB_DRIVER, :profile => profile
Full details here
Upvotes: 1