Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making sure I have a timeout set while using watir to wait for page load

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?

like image 296
David West Avatar asked Dec 15 '22 09:12

David West


1 Answers

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? }
like image 112
adam reed Avatar answered Jan 30 '23 06:01

adam reed