Class: Selenium::WebDriver::Firefox::Bridge
Constant Summary
Remote::Bridge::QUIT_ERRORS
Selenium::WebDriver::Find::FINDERS
Instance Attribute Summary
#capabilities, #context, #http
Instance Method Summary
collapse
#addCookie, #clearElement, #clickElement, #close, command, #create_session, #deleteAllCookies, #deleteCookie, #dragElement, #elementEquals, #executeScript, #findElementByClassName, #findElementById, #findElementByLinkText, #findElementByName, #findElementByPartialLinkText, #findElementByTagName, #findElementByXpath, #findElementsByClassName, #findElementsById, #findElementsByLinkText, #findElementsByName, #findElementsByPartialLinkText, #findElementsByTagName, #findElementsByXpath, #get, #getActiveElement, #getAllCookies, #getCapabilities, #getCurrentUrl, #getCurrentWindowHandle, #getElementAttribute, #getElementLocation, #getElementSize, #getElementTagName, #getElementText, #getElementValue, #getElementValueOfCssProperty, #getPageSource, #getSpeed, #getTitle, #getVisible, #getWindowHandles, #goBack, #goForward, #hoverOverElement, #isElementDisplayed, #isElementEnabled, #isElementSelected, #refresh, #sendKeysToElement, #session_id, #setElementSelected, #setImplicitWaitTimeout, #setSpeed, #setVisible, #submitElement, #switchToDefaultContent, #switchToFrame, #switchToWindow, #toggleElement
#element_id_from, #parse_cookie_string, #unwrap_script_result
#find_element, #find_elements
Constructor Details
#initialize(opts = {}) ⇒ Bridge
Returns a new instance of Bridge.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 8
def initialize(opts = {})
@binary = Binary.new
@launcher = Launcher.new(
@binary,
opts.delete(:port) || DEFAULT_PORT,
opts.delete(:profile) || DEFAULT_PROFILE_NAME
)
http_client = opts.delete(:http_client)
unless opts.empty?
raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
end
@launcher.launch
remote_opts = {
:url => @launcher.url,
:desired_capabilities => :firefox
}
remote_opts.merge!(:http_client => http_client) if http_client
super(remote_opts)
end
|
Instance Method Details
#browser ⇒ Object
34
35
36
|
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 34
def browser
:firefox
end
|
#driver_extensions ⇒ Object
#findElementByCssSelector(parent, selector) ⇒ Object
53
54
55
|
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 53
def findElementByCssSelector(parent, selector)
find_element_by 'css selector', selector, parent
end
|
#findElementsByCssSelector(parent, selector) ⇒ Object
57
58
59
|
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 57
def findElementsByCssSelector(parent, selector)
find_elements_by 'css selector', selector, parent
end
|
#getScreenshot ⇒ Object
49
50
51
|
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 49
def getScreenshot
execute :screenshot
end
|
#quit ⇒ Object
42
43
44
45
46
47
|
# File 'lib/selenium/webdriver/firefox/bridge.rb', line 42
def quit
super
@binary.quit
nil
end
|