Class: Selenium::WebDriver::Timeouts
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Timeouts
- Defined in:
- lib/selenium/webdriver/common/timeouts.rb
Instance Method Summary collapse
-
#implicit_wait ⇒ Object
Gets the amount of time the driver should wait when searching for elements.
-
#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 ⇒ Object
Gets the amount of time to wait for a page load to complete before throwing an error.
-
#page_load=(seconds) ⇒ Object
Sets the amount of time to wait for a page load to complete before throwing an error.
-
#script ⇒ Object
(also: #script_timeout)
Gets the amount of time to wait for an asynchronous script to finish execution before throwing an error.
-
#script=(seconds) ⇒ Object
(also: #script_timeout=)
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 ⇒ Object
Gets 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 Float(@bridge.timeouts['implicit']) / 1000 end |
#implicit_wait=(seconds) ⇒ Object
Set the amount of time the driver should wait when searching for elements.
39 40 41 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 39 def implicit_wait=(seconds) @bridge.timeouts = {'implicit' => Integer(seconds * 1000)} end |
#page_load ⇒ Object
Gets the amount of time to wait for a page load to complete before throwing an error.
68 69 70 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 68 def page_load Float(@bridge.timeouts['pageLoad']) / 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.
77 78 79 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 77 def page_load=(seconds) @bridge.timeouts = {'pageLoad' => Integer(seconds * 1000)} end |
#script ⇒ Object Also known as: script_timeout
Gets the amount of time to wait for an asynchronous script to finish execution before throwing an error.
48 49 50 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 48 def script Float(@bridge.timeouts['script']) / 1000 end |
#script=(seconds) ⇒ Object Also known as: script_timeout=
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.
59 60 61 |
# File 'lib/selenium/webdriver/common/timeouts.rb', line 59 def script=(seconds) @bridge.timeouts = {'script' => Integer(seconds * 1000)} end |