123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::Timeouts

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/common/timeouts.rb

Class Method Summary

Instance Attribute Summary

  • #implicit_wait rw

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

  • #implicit_wait=(seconds) rw

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

  • #page_load rw

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

  • #page_load=(seconds) rw

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

  • #script (also: #script_timeout) rw

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

  • #script=(seconds) (also: #script_timeout=) rw

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

Instance Method Summary

Constructor Details

.new(bridge) ⇒ Timeouts

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 23

def initialize(bridge)
  @bridge = bridge
end

Instance Attribute Details

#implicit_wait (rw)

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

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 31

def implicit_wait
  Float(@bridge.timeouts['implicit']) / 1000
end

#implicit_wait=(seconds) (rw)

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

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 39

def implicit_wait=(seconds)
  @bridge.timeouts = {'implicit' => Integer(seconds * 1000)}
end

#page_load (rw)

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

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 68

def page_load
  Float(@bridge.timeouts['pageLoad']) / 1000
end

#page_load=(seconds) (rw)

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.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 77

def page_load=(seconds)
  @bridge.timeouts = {'pageLoad' => Integer(seconds * 1000)}
end

#script (rw) Also known as: #script_timeout

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

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 48

def script
  Float(@bridge.timeouts['script']) / 1000
end

#script=(seconds) (rw) 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.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/timeouts.rb', line 59

def script=(seconds)
  @bridge.timeouts = {'script' => Integer(seconds * 1000)}
end

Instance Method Details

#script_timeout (writeonly)

Alias for #script.

[ GitHub ]

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

alias script_timeout script