class Selenium::WebDriver::Timeouts

Public Class Methods

new(bridge) click to toggle source
# File lib/selenium/webdriver/common/timeouts.rb, line 23
def initialize(bridge)
  @bridge = bridge
end

Public Instance Methods

implicit_wait() click to toggle source

Gets the amount of time the driver should wait when searching for elements.

# File lib/selenium/webdriver/common/timeouts.rb, line 31
def implicit_wait
  Float(@bridge.timeouts['implicit']) / 1000
end
implicit_wait=(seconds) click to toggle source

Set the amount of time the driver should wait when searching for elements.

# File lib/selenium/webdriver/common/timeouts.rb, line 39
def implicit_wait=(seconds)
  @bridge.timeouts = {'implicit' => Integer(seconds * 1000)}
end
page_load() click to toggle source

Gets the amount of time to wait for a page load to complete before throwing an error.

# File lib/selenium/webdriver/common/timeouts.rb, line 68
def page_load
  Float(@bridge.timeouts['pageLoad']) / 1000
end
page_load=(seconds) click to toggle source

Sets the amount of time to wait for a page load to complete before throwing an error. If the timeout is negative, page loads can be indefinite.

# File lib/selenium/webdriver/common/timeouts.rb, line 77
def page_load=(seconds)
  @bridge.timeouts = {'pageLoad' => Integer(seconds * 1000)}
end
script() click to toggle source

Gets the amount of time to wait for an asynchronous script to finish execution before throwing an error.

# File lib/selenium/webdriver/common/timeouts.rb, line 48
def script
  Float(@bridge.timeouts['script']) / 1000
end
Also aliased as: script_timeout
script=(seconds) click to toggle source

Sets the amount of time to wait for an asynchronous script to finish execution before throwing an error. If the timeout is negative, then the script will be allowed to run indefinitely.

# File lib/selenium/webdriver/common/timeouts.rb, line 59
def script=(seconds)
  @bridge.timeouts = {'script' => Integer(seconds * 1000)}
end
Also aliased as: script_timeout=
script_timeout()
Alias for: script
script_timeout=(seconds)
Alias for: script=