ruby - making 'some_element'.present? in watir wait for less than 5 secs -


How can we create some alarms? Or some_element.lookable? Wait for less than 5 seconds? Because I think some_element.present? Only 30 minutes before the timing will wait for the default value.

Thank you

I believe that you are asking that timeout How to shorten the length of time before, set by 30 seconds by default, to see how to optimize that time.

Accordingly

A clear wait

There are four built in those methods that you can use to make your waiting experience more enjoyable (and your code To remove those bad sleep statements)

  Watir :: Wait until {...}: To be the true object where you can wait for a block. Where_present.set: Where you can do something of the current object. Where you wait for something until the object is present. Where you just disappear for some time, the default timeout for all these methods is 30 seconds, but you can give an argument to increase any of these (or decrease) as needed.  

and

  - wait_until_present (timeout = nil)  

the object waits until it exists

Example:

  browser.button  (: id = & gt; 'foo'). Wait_until_present parameter: timeout (fixnum) (default: zero) - second wait   

example:

  before time expires - wait_while_present (timeout) = Nil)  

. Browser.button (: id = & gt; 'foo') wait_while_present parameter: timeout (integer) (default: zero) - (object) when_present (timeout = zero) Example:

  Browser.button (: id = & gt; 'foo'). When_pozzer.Click the Browser. Div (: id = & gt; 'bar'). When_preview {| Div | | ...} Browser. P (: id = & gt; 'falcon'). When_Presentation (60) .text parameters: timeout (fixation) (by default: zero) - seconds to wait before timeout  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -