Class | Selenium::WebDriver::Driver |
In: |
lib/selenium/webdriver/common/driver.rb
|
Parent: | Object |
The main class through which you control the browser.
@see SearchContext @see Navigation @see TargetLocator @see Options
find_element | -> | first |
driver.first(:id, ‘foo’) | ||
find_elements | -> | all |
driver.all(:class, ‘bar’) #=> [#<WebDriver::Element:0x1011c3b88, …] |
A new Driver instance with the given bridge. End users should use Selenium::WebDriver.for instead of using this directly.
@api private
Get the first element matching the given selector. If given a String or Symbol, it will be used as the id of the element.
@param [String,Hash] id or selector @return [WebDriver::Element]
Examples:
driver['someElementId'] #=> #<WebDriver::Element:0x1011c3b88> driver[:tag_name => 'div'] #=> #<WebDriver::Element:0x1011c3b88>
Execute an asynchronous piece of JavaScript in the context of the currently selected frame or window. Unlike executing execute_script (synchronous JavaScript), scripts executed with this method must explicitly signal they are finished by invoking the provided callback. This callback is always injected into the executed function as the last argument.
JavaSCript source to execute
@param [WebDriver::Element,Integer, Float, Boolean, NilClass, String, Array] *args
Arguments to the script. May be empty.
@return [WebDriver::Element,Integer,Float,Boolean,NilClass,String,Array]
Execute the given JavaScript
JavaScript source to execute
@param [WebDriver::Element,Integer, Float, Boolean, NilClass, String, Array] *args
Arguments will be available in the given script in the 'arguments' pseudo-array.
@return [WebDriver::Element,Integer,Float,Boolean,NilClass,String,Array]
The value returned from the script.
Get the window handles of open browser windows.
@return [Array] @see TargetLocator#window