in watir I want to use browser.wait()
to make sure I've waited until a page is loaded. But, what if the page is never going to load or is just taking a long time. I want to set a timeout. Do I do this with something like browser.wait(8)
, specifying the number of seconds for a timeout?
You can specify the Timeout value in parentheses after the wait statement:
Watir::Wait.until(60) { browser.text.include? 'Hello' }
Watir::Wait.until(60) { browser.div(:id => "mainDiv").exists? }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With