Class: Selenium::WebDriver::Opera::Bridge

Inherits:
Remote::Bridge show all
Defined in:
lib/selenium/webdriver/opera/bridge.rb

Constant Summary

Constants inherited from Remote::Bridge

Remote::Bridge::QUIT_ERRORS

Instance Attribute Summary

Attributes inherited from Remote::Bridge

#context, #file_detector, #http

Instance Method Summary collapse

Methods inherited from Remote::Bridge

#acceptAlert, #addCookie, #clearElement, #click, #clickElement, #close, command, #contextClick, #create_session, #deleteAllCookies, #deleteCookie, #dismissAlert, #doubleClick, #dragElement, #elementEquals, #executeAsyncScript, #executeScript, #find_element_by, #find_elements_by, #get, #getActiveElement, #getAlert, #getAlertText, #getAllCookies, #getCapabilities, #getCurrentUrl, #getCurrentWindowHandle, #getElementAttribute, #getElementLocation, #getElementLocationOnceScrolledIntoView, #getElementSize, #getElementTagName, #getElementText, #getElementValue, #getElementValueOfCssProperty, #getPageSource, #getScreenshot, #getTitle, #getVisible, #getWindowHandles, #goBack, #goForward, #isElementDisplayed, #isElementEnabled, #isElementSelected, #mouseDown, #mouseMoveTo, #mouseUp, #refresh, #sendKeysToActiveElement, #sendKeysToElement, #sendModifierKeyToActiveElement, #session_id, #setAlertValue, #setElementSelected, #setImplicitWaitTimeout, #setScriptTimeout, #setVisible, #submitElement, #switchToDefaultContent, #switchToFrame, #switchToWindow, #upload

Methods included from BridgeHelper

#element_id_from, #parse_cookie_string, #unwrap_script_result

Constructor Details

#initialize(opts = {}) ⇒ Bridge

Returns a new instance of Bridge.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/selenium/webdriver/opera/bridge.rb', line 13

def initialize(opts = {})
  @service = Service.default_service :log => (opts[:logging_level] ? true : false)

  http_client = opts.delete(:http_client)
  caps        = create_capabilities(opts)

  @service.start

  remote_opts = {
    :url                  => @service.uri,
    :desired_capabilities => caps
  }

  remote_opts.merge!(:http_client => http_client) if http_client

  super(remote_opts)
end

Instance Method Details

#browserObject



31
32
33
# File 'lib/selenium/webdriver/opera/bridge.rb', line 31

def browser
  :opera
end

#capabilitiesObject



42
43
44
# File 'lib/selenium/webdriver/opera/bridge.rb', line 42

def capabilities
  @capabilities ||= Remote::Capabilities.opera
end

#driver_extensionsObject



35
36
37
38
39
40
# File 'lib/selenium/webdriver/opera/bridge.rb', line 35

def driver_extensions
  [
    DriverExtensions::HasInputDevices,
    DriverExtensions::TakesScreenshot
  ]
end

#quitObject



46
47
48
49
50
# File 'lib/selenium/webdriver/opera/bridge.rb', line 46

def quit
  super
ensure
  @service.stop
end