class

Selenium::Helpers::Wait

Inherits Reference < Object

Constructors

new(timeout : Time::Span = 5.seconds, interval : Time::Span = 0.2.seconds, ignored : Array(Exception) | Array(::Selenium::Error.class) = [Selenium::Error], message : String | Nil = nil)

Create a new Wait instance.

timeout - seconds to wait before timing out interval - seconds to sleep between polls message - exception mesage if timed out ignored - exceptions to ignore while polling

Source

Instance methods

until

Wait until the given block returns a true value. Otherwise raise an exception IO::TimeoutError.

wait = Selenium::Helpers::Wait.new(timeout: 10.seconds, interval: 1.second)
wait.until { session.document_manager.execute_script("return document.readyState;") == "complete" }
Source