Class: Selenium::WebDriver::Timeouts

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/common/timeouts.rb

Instance Method Summary collapse

Constructor Details

#initialize(bridge) ⇒ Timeouts

Returns a new instance of Timeouts.



24
25
26
# File 'lib/selenium/webdriver/common/timeouts.rb', line 24

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#implicit_wait=(seconds) ⇒ Object

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



32
33
34
# File 'lib/selenium/webdriver/common/timeouts.rb', line 32

def implicit_wait=(seconds)
  @bridge.setImplicitWaitTimeout Integer(seconds * 1000)
end

#page_load=(seconds) ⇒ Object

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.



51
52
53
# File 'lib/selenium/webdriver/common/timeouts.rb', line 51

def page_load=(seconds)
  @bridge.setTimeout 'page load', Integer(seconds * 1000)
end

#script_timeout=(seconds) ⇒ Object

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.



42
43
44
# File 'lib/selenium/webdriver/common/timeouts.rb', line 42

def script_timeout=(seconds)
  @bridge.setScriptTimeout Integer(seconds * 1000)
end