Class: Selenium::WebDriver::Safari::Bridge

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

Constant Summary collapse

COMMAND_TIMEOUT =
60

Constants inherited from Remote::Bridge

Remote::Bridge::QUIT_ERRORS

Instance Attribute Summary

Attributes inherited from Remote::Bridge

#capabilities, #context, #file_detector, #http

Instance Method Summary collapse

Methods inherited from Remote::Bridge

#acceptAlert, #addCookie, #browser, #clearElement, #clearLocalStorage, #clearSessionStorage, #click, #clickElement, #close, command, #contextClick, #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



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/selenium/webdriver/safari/bridge.rb', line 9

def initialize(opts = {})
  port = Integer(opts[:port] || PortProber.random)
  timeout = Integer(opts[:timeout] || COMMAND_TIMEOUT)

  @command_id ||= 0

  @server = Server.new(port, timeout)
  @server.start

  @browser = Browser.new
  @browser.start(prepare_connect_file)

  @server.wait_for_connection

  super(:desired_capabilities => :safari)
end

Instance Method Details

#driver_extensionsObject



33
34
35
# File 'lib/selenium/webdriver/safari/bridge.rb', line 33

def driver_extensions
  []
end

#quitObject



26
27
28
29
30
31
# File 'lib/selenium/webdriver/safari/bridge.rb', line 26

def quit
  super

  @server.stop
  @browser.stop
end