Class: Selenium::WebDriver::Timeouts
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Timeouts
- Defined in:
- lib/selenium/webdriver/common/timeouts.rb
Instance Method Summary collapse
-
#implicit_wait=(seconds) ⇒ Object
Set the amount of time the driver should wait when searching for elements.
-
#initialize(bridge) ⇒ Timeouts
constructor
A new instance of Timeouts.
-
#page_load=(seconds) ⇒ Object
Sets the amount of time to wait for a page load to complete before throwing an error.
-
#script_timeout=(seconds) ⇒ Object
Sets the amount of time to wait for an asynchronous script to finish execution before throwing an error.
Constructor Details
#initialize(bridge) ⇒ Timeouts
Returns a new instance of Timeouts.
23 24 25 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 23 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.
31 32 33 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 31 def implicit_wait=(seconds) @bridge.implicit_wait_timeout = 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.
50 51 52 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 50 def page_load=(seconds) @bridge.timeout '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.
41 42 43 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 41 def script_timeout=(seconds) @bridge.script_timeout = Integer(seconds * 1000) end |