class Selenium::Helpers::Wait

Defined in:

selenium/helpers/wait.cr

Constructors

Instance Method Summary

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


[View source]

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" }

[View source]