Class: Selenium::WebDriver::Android::Bridge

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

Constant Summary collapse

DEFAULT_URL =
"http://#{Platform.localhost}:8080/hub/"

Constants inherited from Remote::Bridge

Remote::Bridge::QUIT_ERRORS

Instance Attribute Summary

Attributes inherited from Remote::Bridge

#context, #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, #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, #quit, #refresh, #sendKeysToElement, #sendModifierKeyToActiveElement, #session_id, #setAlertValue, #setElementSelected, #setImplicitWaitTimeout, #setScriptTimeout, #setVisible, #submitElement, #switchToDefaultContent, #switchToFrame, #switchToWindow

Methods included from BridgeHelper

#element_id_from, #parse_cookie_string, #unwrap_script_result

Constructor Details

#initialize(opts = {}) ⇒ Bridge

Returns a new instance of Bridge.



8
9
10
11
12
13
14
15
16
# File 'lib/selenium/webdriver/android/bridge.rb', line 8

def initialize(opts = {})
  remote_opts = {
    :url                  => opts.fetch(:url, DEFAULT_URL),
    :desired_capabilities => opts.fetch(:desired_capabilities, capabilities),
    :http_client          => opts[:http_client]
  }

  super remote_opts
end

Instance Method Details

#browserObject



18
19
20
# File 'lib/selenium/webdriver/android/bridge.rb', line 18

def browser
  :android
end

#capabilitiesObject



38
39
40
# File 'lib/selenium/webdriver/android/bridge.rb', line 38

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

#driver_extensionsObject



22
23
24
25
26
27
28
# File 'lib/selenium/webdriver/android/bridge.rb', line 22

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

#getScreenOrientationObject



34
35
36
# File 'lib/selenium/webdriver/android/bridge.rb', line 34

def getScreenOrientation
  execute :getScreenOrientation
end

#setScreenOrientation(orientation) ⇒ Object



30
31
32
# File 'lib/selenium/webdriver/android/bridge.rb', line 30

def setScreenOrientation(orientation)
  execute :setScreenOrientation, {}, :orientation => orientation
end