Class: Selenium::WebDriver::Remote::Bridge Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Remote::Bridge
- Includes:
- BridgeHelper
- Defined in:
- rb/lib/selenium/webdriver/remote/bridge.rb,
rb/lib/selenium/webdriver/remote/commands.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Android::Bridge, Chrome::Bridge, Firefox::Bridge, IE::Bridge, IPhone::Bridge, Opera::Bridge, PhantomJS::Bridge, Safari::Bridge
Constant Summary
- QUIT_ERRORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[IOError]
Instance Attribute Summary (collapse)
- - (Object) capabilities readonly private
- - (Object) context private
- - (Object) file_detector private
- - (Object) http private
Class Method Summary (collapse)
-
+ (Object) command(name, verb, url)
private
Defines a wrapper method for a command, which ultimately calls #execute.
Instance Method Summary (collapse)
- - (Object) acceptAlert private
-
- (Object) addCookie(cookie)
private
cookies.
- - (Object) browser private
- - (Object) clearElement(element) private
- - (Object) clearLocalStorage private
- - (Object) clearSessionStorage private
- - (Object) click private
-
- (Object) clickElement(element)
private
actions.
- - (Object) close private
- - (Object) contextClick private
- - (Object) create_session(desired_capabilities) private
- - (Object) deleteAllCookies private
- - (Object) deleteCookie(name) private
- - (Object) dismissAlert private
- - (Object) doubleClick private
- - (Object) dragElement(element, right_by, down_by) private
- - (Object) driver_extensions private
- - (Object) elementEquals(element, other) private
- - (Object) executeAsyncScript(script, *args) private
-
- (Object) executeScript(script, *args)
private
javascript execution.
- - (Object) find_element_by(how, what, parent = nil) private
- - (Object) find_elements_by(how, what, parent = nil) private
- - (Object) get(url) private
-
- (Object) getActiveElement
(also: #switchToActiveElement)
private
finding elements.
-
- (Object) getAlert
private
alerts.
- - (Object) getAlertText private
- - (Object) getAllCookies private
-
- (Object) getAvailableLogTypes
private
logs.
- - (Object) getCapabilities private
- - (Object) getCurrentUrl private
- - (Object) getCurrentWindowHandle private
- - (Object) getElementAttribute(element, name) private
- - (Object) getElementLocation(element) private
- - (Object) getElementLocationOnceScrolledIntoView(element) private
- - (Object) getElementSize(element) private
-
- (Object) getElementTagName(element)
private
element properties.
- - (Object) getElementText(element) private
- - (Object) getElementValue(element) private
- - (Object) getElementValueOfCssProperty(element, prop) private
-
- (Object) getLocalStorageItem(key)
private
HTML 5.
- - (Object) getLocalStorageKeys private
- - (Object) getLocalStorageSize private
- - (Object) getLocation private
- - (Object) getLog(type) private
- - (Object) getPageSource private
- - (Object) getScreenOrientation private
- - (Object) getScreenshot private
- - (Object) getSessionStorageItem(key) private
- - (Object) getSessionStorageKeys private
- - (Object) getSessionStorageSize private
- - (Object) getTitle private
- - (Object) getVisible private
-
- (Object) getWindowHandles
private
window handling.
- - (Object) getWindowPosition(handle = :current) private
- - (Object) getWindowSize(handle = :current) private
-
- (Object) goBack
private
navigation.
- - (Object) goForward private
-
- (Bridge) initialize(opts = {})
constructor
private
Initializes the bridge with the given server URL.
- - (Object) isBrowserOnline private
- - (Object) isElementDisplayed(element) private
- - (Object) isElementEnabled(element) private
- - (Object) isElementSelected(element) private
- - (Object) maximizeWindow(handle = :current) private
- - (Object) mouseDown private
- - (Object) mouseMoveTo(element, x = nil, y = nil) private
- - (Object) mouseUp private
- - (Object) quit private
- - (Object) refresh private
- - (Object) removeLocalStorageItem(key) private
- - (Object) removeSessionStorageItem(key) private
- - (Object) sendKeysToActiveElement(key) private
- - (Object) sendKeysToElement(element, keys) private
-
- (Object) session_id
private
Returns the current session ID.
- - (Object) setAlertValue(keys) private
- - (Object) setBrowserOnline(bool) private
- - (Object) setImplicitWaitTimeout(milliseconds) private
- - (Object) setLocalStorageItem(key, value) private
- - (Object) setLocation(lat, lon, alt) private
- - (Object) setScreenOrientation(orientation) private
- - (Object) setScriptTimeout(milliseconds) private
- - (Object) setSessionStorageItem(key, value) private
- - (Object) setTimeout(type, milliseconds) private
- - (Object) setVisible(bool) private
- - (Object) setWindowPosition(x, y, handle = :current) private
- - (Object) setWindowSize(width, height, handle = :current) private
- - (Object) status private
- - (Object) submitElement(element) private
- - (Object) switchToDefaultContent private
- - (Object) switchToFrame(id) private
- - (Object) switchToWindow(name) private
- - (Object) touchDoubleTap(element) private
- - (Object) touchDown(x, y) private
- - (Object) touchElementFlick(element, right_by, down_by, speed) private
- - (Object) touchFlick(xspeed, yspeed) private
- - (Object) touchLongPress(element) private
- - (Object) touchMove(x, y) private
- - (Object) touchScroll(element, x, y) private
- - (Object) touchSingleTap(element) private
- - (Object) touchUp(x, y) private
- - (Object) upload(local_file) private
Methods included from BridgeHelper
#element_id_from, #parse_cookie_string, #unwrap_script_result
Constructor Details
- (Bridge) initialize(opts = {})
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the bridge with the given server URL.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 43 def initialize(opts = {}) opts = opts.dup http_client = opts.delete(:http_client) { Http::Default.new } desired_capabilities = opts.delete(:desired_capabilities) { Capabilities.firefox } url = opts.delete(:url) { "http://#{Platform.localhost}:4444/wd/hub" } unless opts.empty? raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}" end if desired_capabilities.kind_of?(Symbol) unless Capabilities.respond_to?(desired_capabilities) raise Error::WebDriverError, "invalid desired capability: #{desired_capabilities.inspect}" end desired_capabilities = Capabilities.send(desired_capabilities) end uri = url.kind_of?(URI) ? url : URI.parse(url) uri.path += "/" unless uri.path =~ /\/$/ http_client.server_url = uri @http = http_client @capabilities = create_session(desired_capabilities) end |
Instance Attribute Details
- (Object) capabilities (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 33 def capabilities @capabilities end |
- (Object) context
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 32 def context @context end |
- (Object) file_detector
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 32 def file_detector @file_detector end |
- (Object) http
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 32 def http @http end |
Class Method Details
+ (Object) command(name, verb, url)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Defines a wrapper method for a command, which ultimately calls #execute.
28 29 30 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 28 def self.command(name, verb, url) COMMANDS[name] = [verb, url.freeze] end |
Instance Method Details
- (Object) acceptAlert
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
137 138 139 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 137 def acceptAlert execute :acceptAlert end |
- (Object) addCookie(cookie)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
cookies
348 349 350 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 348 def addCookie() execute :addCookie, {}, :cookie => end |
- (Object) browser
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
71 72 73 74 75 76 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 71 def browser @browser ||= ( name = @capabilities.browser_name name ? name.gsub(" ", "_").to_sym : 'unknown' ) end |
- (Object) clearElement(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
422 423 424 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 422 def clearElement(element) execute :clearElement, :id => element end |
- (Object) clearLocalStorage
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
276 277 278 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 276 def clearLocalStorage execute :clearLocalStorage end |
- (Object) clearSessionStorage
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
300 301 302 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 300 def clearSessionStorage execute :clearSessionStorage end |
- (Object) click
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
372 373 374 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 372 def click execute :click, {}, :button => 0 end |
- (Object) clickElement(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
actions
368 369 370 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 368 def clickElement(element) execute :clickElement, :id => element end |
- (Object) close
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
205 206 207 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 205 def close execute :close end |
- (Object) contextClick
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
380 381 382 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 380 def contextClick execute :click, {}, :button => 2 end |
- (Object) create_session(desired_capabilities)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 101 102 103 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 98 def create_session(desired_capabilities) resp = raw_execute :newSession, {}, :desiredCapabilities => desired_capabilities @session_id = resp['sessionId'] or raise Error::WebDriverError, 'no sessionId in returned payload' Capabilities.json_create resp['value'] end |
- (Object) deleteAllCookies
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
360 361 362 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 360 def deleteAllCookies execute :deleteAllCookies end |
- (Object) deleteCookie(name)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
352 353 354 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 352 def deleteCookie(name) execute :deleteCookie, :name => name end |
- (Object) dismissAlert
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
141 142 143 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 141 def dismissAlert execute :dismissAlert end |
- (Object) doubleClick
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
376 377 378 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 376 def doubleClick execute :doubleClick end |
- (Object) dragElement(element, right_by, down_by)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
431 432 433 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 431 def dragElement(element, right_by, down_by) execute :dragElement, {:id => element}, :x => right_by, :y => down_by end |
- (Object) driver_extensions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
78 79 80 81 82 83 84 85 86 87 88 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 78 def driver_extensions [ DriverExtensions::HasInputDevices, DriverExtensions::UploadsFiles, DriverExtensions::TakesScreenshot, DriverExtensions::HasSessionId, DriverExtensions::Rotatable, DriverExtensions::HasTouchScreen, DriverExtensions::HasRemoteStatus ] end |
- (Object) elementEquals(element, other)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
559 560 561 562 563 564 565 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 559 def elementEquals(element, other) if element.ref == other.ref true else execute :elementEquals, :id => element.ref, :other => other.ref end end |
- (Object) executeAsyncScript(script, *args)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
337 338 339 340 341 342 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 337 def executeAsyncScript(script, *args) assert_javascript_enabled result = execute :executeAsyncScript, {}, :script => script, :args => args unwrap_script_result result end |
- (Object) executeScript(script, *args)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
javascript execution
330 331 332 333 334 335 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 330 def executeScript(script, *args) assert_javascript_enabled result = execute :executeScript, {}, :script => script, :args => args unwrap_script_result result end |
- (Object) find_element_by(how, what, parent = nil)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
576 577 578 579 580 581 582 583 584 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 576 def find_element_by(how, what, parent = nil) if parent id = execute :findChildElement, {:id => parent}, {:using => how, :value => what} else id = execute :findElement, {}, {:using => how, :value => what} end Element.new self, element_id_from(id) end |
- (Object) find_elements_by(how, what, parent = nil)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
586 587 588 589 590 591 592 593 594 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 586 def find_elements_by(how, what, parent = nil) if parent ids = execute :findChildElements, {:id => parent}, {:using => how, :value => what} else ids = execute :findElements, {}, {:using => how, :value => what} end ids.map { |id| Element.new self, element_id_from(id) } end |
- (Object) get(url)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
109 110 111 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 109 def get(url) execute :get, {}, :url => url end |
- (Object) getActiveElement Also known as: switchToActiveElement
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
finding elements
571 572 573 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 571 def getActiveElement Element.new self, element_id_from(execute(:getActiveElement)) end |
- (Object) getAlert
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
alerts
133 134 135 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 133 def getAlert execute :getAlert end |
- (Object) getAlertText
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
149 150 151 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 149 def getAlertText execute :getAlertText end |
- (Object) getAllCookies
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
356 357 358 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 356 def getAllCookies execute :getCookies end |
- (Object) getAvailableLogTypes
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
logs
493 494 495 496 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 493 def getAvailableLogTypes types = execute :getAvailableLogTypes Array(types).map { |e| e.to_sym } end |
- (Object) getCapabilities
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
113 114 115 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 113 def getCapabilities Capabilities.json_create execute(:getCapabilities) end |
- (Object) getCurrentUrl
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
165 166 167 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 165 def getCurrentUrl execute :getCurrentUrl end |
- (Object) getCurrentWindowHandle
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
221 222 223 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 221 def getCurrentWindowHandle execute :getCurrentWindowHandle end |
- (Object) getElementAttribute(element, name)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
514 515 516 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 514 def getElementAttribute(element, name) execute :getElementAttribute, :id => element, :name => name end |
- (Object) getElementLocation(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
526 527 528 529 530 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 526 def getElementLocation(element) data = execute :getElementLocation, :id => element Point.new data['x'], data['y'] end |
- (Object) getElementLocationOnceScrolledIntoView(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
532 533 534 535 536 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 532 def getElementLocationOnceScrolledIntoView(element) data = execute :getElementLocationOnceScrolledIntoView, :id => element Point.new data['x'], data['y'] end |
- (Object) getElementSize(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
538 539 540 541 542 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 538 def getElementSize(element) data = execute :getElementSize, :id => element Dimension.new data['width'], data['height'] end |
- (Object) getElementTagName(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
element properties
510 511 512 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 510 def getElementTagName(element) execute :getElementTagName, :id => element end |
- (Object) getElementText(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
522 523 524 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 522 def getElementText(element) execute :getElementText, :id => element end |
- (Object) getElementValue(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
518 519 520 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 518 def getElementValue(element) execute :getElementValue, :id => element end |
- (Object) getElementValueOfCssProperty(element, prop)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
555 556 557 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 555 def getElementValueOfCssProperty(element, prop) execute :getElementValueOfCssProperty, :id => element, :property_name => prop end |
- (Object) getLocalStorageItem(key)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
HTML 5
260 261 262 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 260 def getLocalStorageItem(key) execute :getLocalStorageItem, :key => key end |
- (Object) getLocalStorageKeys
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
268 269 270 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 268 def getLocalStorageKeys execute :getLocalStorageKeys end |
- (Object) getLocalStorageSize
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
280 281 282 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 280 def getLocalStorageSize execute :getLocalStorageSize end |
- (Object) getLocation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
308 309 310 311 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 308 def getLocation obj = execute(:getLocation) || {} # android returns null Location.new obj['latitude'], obj['longitude'], obj['altitude'] end |
- (Object) getLog(type)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
498 499 500 501 502 503 504 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 498 def getLog(type) data = execute :getLog, {}, :type => type.to_s Array(data).map do |l| LogEntry.new l.fetch('level'), l.fetch('timestamp'), l.fetch('message') end end |
- (Object) getPageSource
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
173 174 175 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 173 def getPageSource execute :getPageSource end |
- (Object) getScreenOrientation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
485 486 487 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 485 def getScreenOrientation execute :getScreenOrientation end |
- (Object) getScreenshot
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
252 253 254 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 252 def getScreenshot execute :screenshot end |
- (Object) getSessionStorageItem(key)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
284 285 286 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 284 def getSessionStorageItem(key) execute :getSessionStorageItem, :key => key end |
- (Object) getSessionStorageKeys
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
292 293 294 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 292 def getSessionStorageKeys execute :getSessionStorageKeys end |
- (Object) getSessionStorageSize
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
304 305 306 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 304 def getSessionStorageSize execute :getSessionStorageSize end |
- (Object) getTitle
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
169 170 171 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 169 def getTitle execute :getTitle end |
- (Object) getVisible
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
177 178 179 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 177 def getVisible execute :getVisible end |
- (Object) getWindowHandles
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
window handling
217 218 219 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 217 def getWindowHandles execute :getWindowHandles end |
- (Object) getWindowPosition(handle = :current)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
246 247 248 249 250 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 246 def getWindowPosition(handle = :current) data = execute :getWindowPosition, :window_handle => handle Point.new data['x'], data['y'] end |
- (Object) getWindowSize(handle = :current)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
235 236 237 238 239 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 235 def getWindowSize(handle = :current) data = execute :getWindowSize, :window_handle => handle Dimension.new data['width'], data['height'] end |
- (Object) goBack
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
navigation
157 158 159 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 157 def goBack execute :goBack end |
- (Object) goForward
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
161 162 163 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 161 def goForward execute :goForward end |
- (Object) isBrowserOnline
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
318 319 320 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 318 def isBrowserOnline execute :isBrowserOnline end |
- (Object) isElementDisplayed(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
552 553 554 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 552 def isElementDisplayed(element) execute :isElementDisplayed, :id => element end |
- (Object) isElementEnabled(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
544 545 546 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 544 def isElementEnabled(element) execute :isElementEnabled, :id => element end |
- (Object) isElementSelected(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
548 549 550 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 548 def isElementSelected(element) execute :isElementSelected, :id => element end |
- (Object) maximizeWindow(handle = :current)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
231 232 233 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 231 def maximizeWindow(handle = :current) execute :maximizeWindow, :window_handle => handle end |
- (Object) mouseDown
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
384 385 386 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 384 def mouseDown execute :mouseDown end |
- (Object) mouseMoveTo(element, x = nil, y = nil)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
392 393 394 395 396 397 398 399 400 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 392 def mouseMoveTo(element, x = nil, y = nil) params = { :element => element } if x && y params.merge! :xoffset => x, :yoffset => y end execute :mouseMoveTo, {}, params end |
- (Object) mouseUp
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
388 389 390 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 388 def mouseUp execute :mouseUp end |
- (Object) quit
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
199 200 201 202 203 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 199 def quit execute :quit http.close rescue *QUIT_ERRORS end |
- (Object) refresh
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
209 210 211 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 209 def refresh execute :refresh end |
- (Object) removeLocalStorageItem(key)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
264 265 266 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 264 def removeLocalStorageItem(key) execute :removeLocalStorageItem, :key => key end |
- (Object) removeSessionStorageItem(key)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
288 289 290 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 288 def removeSessionStorageItem(key) execute :removeSessionStorageItem, :key => key end |
- (Object) sendKeysToActiveElement(key)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
402 403 404 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 402 def sendKeysToActiveElement(key) execute :sendKeysToActiveElement, {}, :value => key end |
- (Object) sendKeysToElement(element, keys)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
406 407 408 409 410 411 412 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 406 def sendKeysToElement(element, keys) if @file_detector && local_file = @file_detector.call(keys) keys = upload(local_file) end execute :sendKeysToElement, {:id => element}, {:value => Array(keys)} end |
- (Object) session_id
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the current session ID.
94 95 96 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 94 def session_id @session_id || raise(Error::WebDriverError, "no current session exists") end |
- (Object) setAlertValue(keys)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
145 146 147 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 145 def setAlertValue(keys) execute :setAlertValue, {}, :text => keys.to_s end |
- (Object) setBrowserOnline(bool)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
322 323 324 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 322 def setBrowserOnline(bool) execute :setBrowserOnline, {}, :state => bool end |
- (Object) setImplicitWaitTimeout(milliseconds)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
117 118 119 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 117 def setImplicitWaitTimeout(milliseconds) execute :implicitlyWait, {}, :ms => milliseconds end |
- (Object) setLocalStorageItem(key, value)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
272 273 274 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 272 def setLocalStorageItem(key, value) execute :setLocalStorageItem, {}, :key => key, :value => value end |
- (Object) setLocation(lat, lon, alt)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
313 314 315 316 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 313 def setLocation(lat, lon, alt) loc = {:latitude => lat, :longitude => lon, :altitude => alt} execute :setLocation, {}, :location => loc end |
- (Object) setScreenOrientation(orientation)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
481 482 483 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 481 def setScreenOrientation(orientation) execute :setScreenOrientation, {}, :orientation => orientation end |
- (Object) setScriptTimeout(milliseconds)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
121 122 123 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 121 def setScriptTimeout(milliseconds) execute :setScriptTimeout, {}, :ms => milliseconds end |
- (Object) setSessionStorageItem(key, value)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
296 297 298 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 296 def setSessionStorageItem(key, value) execute :setSessionStorageItem, {}, :key => key, :value => value end |
- (Object) setTimeout(type, milliseconds)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
125 126 127 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 125 def setTimeout(type, milliseconds) execute :setTimeout, {}, :type => type, :ms => milliseconds end |
- (Object) setVisible(bool)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
181 182 183 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 181 def setVisible(bool) execute :setVisible, {}, bool end |
- (Object) setWindowPosition(x, y, handle = :current)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
241 242 243 244 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 241 def setWindowPosition(x, y, handle = :current) execute :setWindowPosition, {:window_handle => handle}, :x => x, :y => y end |
- (Object) setWindowSize(width, height, handle = :current)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
225 226 227 228 229 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 225 def setWindowSize(width, height, handle = :current) execute :setWindowSize, {:window_handle => handle}, :width => width, :height => height end |
- (Object) status
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
105 106 107 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 105 def status execute :status end |
- (Object) submitElement(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
427 428 429 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 427 def submitElement(element) execute :submitElement, :id => element end |
- (Object) switchToDefaultContent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
193 194 195 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 193 def switchToDefaultContent execute :switchToFrame, {}, :id => nil end |
- (Object) switchToFrame(id)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
189 190 191 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 189 def switchToFrame(id) execute :switchToFrame, {}, :id => id end |
- (Object) switchToWindow(name)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
185 186 187 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 185 def switchToWindow(name) execute :switchToWindow, {}, :name => name end |
- (Object) touchDoubleTap(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
439 440 441 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 439 def touchDoubleTap(element) execute :touchDoubleTap, {}, :element => element end |
- (Object) touchDown(x, y)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
447 448 449 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 447 def touchDown(x, y) execute :touchDown, {}, :x => x, :y => y end |
- (Object) touchElementFlick(element, right_by, down_by, speed)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
473 474 475 476 477 478 479 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 473 def touchElementFlick(element, right_by, down_by, speed) execute :touchFlick, {}, :element => element, :xoffset => right_by, :yoffset => down_by, :speed => speed end |
- (Object) touchFlick(xspeed, yspeed)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
469 470 471 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 469 def touchFlick(xspeed, yspeed) execute :touchFlick, {}, :xspeed => xspeed, :yspeed => yspeed end |
- (Object) touchLongPress(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
443 444 445 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 443 def touchLongPress(element) execute :touchLongPress, {}, :element => element end |
- (Object) touchMove(x, y)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
455 456 457 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 455 def touchMove(x, y) execute :touchMove, {}, :x => x, :y => y end |
- (Object) touchScroll(element, x, y)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
459 460 461 462 463 464 465 466 467 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 459 def touchScroll(element, x, y) if element execute :touchScroll, {}, :element => element, :xoffset => x, :yoffset => y else execute :touchScroll, {}, :xoffset => x, :yoffset => y end end |
- (Object) touchSingleTap(element)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
435 436 437 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 435 def touchSingleTap(element) execute :touchSingleTap, {}, :element => element end |
- (Object) touchUp(x, y)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
451 452 453 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 451 def touchUp(x, y) execute :touchUp, {}, :x => x, :y => y end |
- (Object) upload(local_file)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
414 415 416 417 418 419 420 |
# File 'rb/lib/selenium/webdriver/remote/bridge.rb', line 414 def upload(local_file) unless File.file?(local_file) raise Error::WebDriverError, "you may only upload files: #{local_file.inspect}" end execute :uploadFile, {}, :file => Zipper.zip_file(local_file) end |