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
This is how I wait for AJAX in my project:
ajax_loader = $b.element(:xpath => "//*[@id='spinner-modal-transparent' and @aria-hidden='true']/div/div/div/div/img[@alt='Ajax transparent loader']")
if ajax_loader.exists?
ajax_loader.wait_while_present(timeout=350)
else
puts "The AJAX loader was not present."
end