Using watir-webdriver, how do I wait for a page to load after I click a link?
At the moment I am using:
sleep n
But this is not ideal a
The best summary is found in "Waiting".
This is it in a nutshell:
require 'watir-webdriver'
b = Watir::Browser.start 'bit.ly/watir-webdriver-demo'
b.select_list(:id => 'entry_1').wait_until_present
b.text_field(:id => 'entry_0').when_present.set 'your name'
b.button(:value => 'Submit').click
b.button(:value => 'Submit').wait_while_present
Watir::Wait.until { b.text.include? 'Thank you' }