class Selenium::Helpers::Wait
- Selenium::Helpers::Wait
- Reference
- Object
Defined in:
selenium/helpers/wait.crConstructors
-
.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.
Instance Method Summary
-
#until(&) : Nil
Wait until the given block returns a
true
value.
Constructor Detail
def self.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
Instance Method Detail
def until(&) : Nil
#
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" }