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, #clearLocalStorage, #clearSessionStorage, #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, #getLocalStorageItem, #getLocalStorageKeys, #getLocalStorageSize, #getLocation, #getPageSource, #getScreenshot, #getSessionStorageItem, #getSessionStorageKeys, #getSessionStorageSize, #getTitle, #getVisible, #getWindowHandles, #getWindowPosition, #getWindowSize, #goBack, #goForward, #isBrowserOnline, #isElementDisplayed, #isElementEnabled, #isElementSelected, #maximizeWindow, #mouseDown, #mouseMoveTo, #mouseUp, #refresh, #removeLocalStorageItem, #removeSessionStorageItem, #sendKeysToActiveElement, #sendKeysToElement, #session_id, #setAlertValue, #setBrowserOnline, #setImplicitWaitTimeout, #setLocalStorageItem, #setLocation, #setScriptTimeout, #setSessionStorageItem, #setTimeout, #setVisible, #setWindowPosition, #setWindowSize, #submitElement, #switchToDefaultContent, #switchToFrame, #switchToWindow, #touchDoubleTap, #touchDown, #touchElementFlick, #touchFlick, #touchLongPress, #touchMove, #touchScroll, #touchSingleTap, #touchUp, #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