Class: Selenium::WebDriver::Remote::Bridge Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Remote::Bridge
- Includes:
- BridgeHelper
- Defined in:
- lib/selenium/webdriver/remote/bridge.rb,
lib/selenium/webdriver/remote/commands.rb
Overview
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.
Licensed to the Software Freedom Conservancy (SFC) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The SFC licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Direct Known Subclasses
Android::Bridge, Chrome::Bridge, Edge::Bridge, Firefox::Bridge, IE::Bridge, IPhone::Bridge, PhantomJS::Bridge, Safari::Bridge
Constant Summary collapse
- COMMANDS =
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.
{}
- 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
- #capabilities ⇒ Object readonly private
- #context ⇒ Object private
- #file_detector ⇒ Object private
- #http ⇒ Object private
Class Method Summary collapse
-
.command(name, verb, url) ⇒ Object
private
Defines a wrapper method for a command, which ultimately calls #execute.
Instance Method Summary collapse
- #acceptAlert ⇒ Object private
-
#addCookie(cookie) ⇒ Object
private
cookies.
- #browser ⇒ Object private
- #clearElement(element) ⇒ Object private
- #clearLocalStorage ⇒ Object private
- #clearSessionStorage ⇒ Object private
- #click ⇒ Object private
-
#clickElement(element) ⇒ Object
private
actions.
- #close ⇒ Object private
- #contextClick ⇒ Object private
- #create_session(desired_capabilities) ⇒ Object private
- #deleteAllCookies ⇒ Object private
- #deleteCookie(name) ⇒ Object private
- #dismissAlert ⇒ Object private
- #doubleClick ⇒ Object private
- #dragElement(element, right_by, down_by) ⇒ Object private
- #driver_extensions ⇒ Object private
- #elementEquals(element, other) ⇒ Object private
- #executeAsyncScript(script, *args) ⇒ Object private
-
#executeScript(script, *args) ⇒ Object
private
javascript execution.
- #find_element_by(how, what, parent = nil) ⇒ Object private
- #find_elements_by(how, what, parent = nil) ⇒ Object private
- #get(url) ⇒ Object private
-
#getActiveElement ⇒ Object
(also: #switchToActiveElement)
private
finding elements.
-
#getAlert ⇒ Object
private
alerts.
- #getAlertText ⇒ Object private
- #getAllCookies ⇒ Object private
-
#getAvailableLogTypes ⇒ Object
private
logs.
- #getCapabilities ⇒ Object private
- #getCurrentUrl ⇒ Object private
- #getCurrentWindowHandle ⇒ Object private
- #getElementAttribute(element, name) ⇒ Object private
- #getElementLocation(element) ⇒ Object private
- #getElementLocationOnceScrolledIntoView(element) ⇒ Object private
- #getElementSize(element) ⇒ Object private
-
#getElementTagName(element) ⇒ Object
private
element properties.
- #getElementText(element) ⇒ Object private
- #getElementValue(element) ⇒ Object private
- #getElementValueOfCssProperty(element, prop) ⇒ Object private
-
#getLocalStorageItem(key) ⇒ Object
private
HTML 5.
- #getLocalStorageKeys ⇒ Object private
- #getLocalStorageSize ⇒ Object private
- #getLocation ⇒ Object private
- #getLog(type) ⇒ Object private
- #getNetworkConnection ⇒ Object private
- #getPageSource ⇒ Object private
- #getScreenOrientation ⇒ Object private
- #getScreenshot ⇒ Object private
- #getSessionStorageItem(key) ⇒ Object private
- #getSessionStorageKeys ⇒ Object private
- #getSessionStorageSize ⇒ Object private
- #getTitle ⇒ Object private
- #getVisible ⇒ Object private
-
#getWindowHandles ⇒ Object
private
window handling.
- #getWindowPosition(handle = :current) ⇒ Object private
- #getWindowSize(handle = :current) ⇒ Object private
-
#goBack ⇒ Object
private
navigation.
- #goForward ⇒ Object private
-
#initialize(opts = {}) ⇒ Bridge
constructor
private
Initializes the bridge with the given server URL.
- #isElementDisplayed(element) ⇒ Object private
- #isElementEnabled(element) ⇒ Object private
- #isElementSelected(element) ⇒ Object private
- #maximizeWindow(handle = :current) ⇒ Object private
- #mouseDown ⇒ Object private
- #mouseMoveTo(element, x = nil, y = nil) ⇒ Object private
- #mouseUp ⇒ Object private
- #quit ⇒ Object private
- #refresh ⇒ Object private
- #removeLocalStorageItem(key) ⇒ Object private
- #removeSessionStorageItem(key) ⇒ Object private
- #sendKeysToActiveElement(key) ⇒ Object private
- #sendKeysToElement(element, keys) ⇒ Object private
-
#session_id ⇒ Object
private
Returns the current session ID.
- #setAlertValue(keys) ⇒ Object private
- #setImplicitWaitTimeout(milliseconds) ⇒ Object private
- #setLocalStorageItem(key, value) ⇒ Object private
- #setLocation(lat, lon, alt) ⇒ Object private
- #setNetworkConnection(type) ⇒ Object private
- #setScreenOrientation(orientation) ⇒ Object private
- #setScriptTimeout(milliseconds) ⇒ Object private
- #setSessionStorageItem(key, value) ⇒ Object private
- #setTimeout(type, milliseconds) ⇒ Object private
- #setVisible(bool) ⇒ Object private
- #setWindowPosition(x, y, handle = :current) ⇒ Object private
- #setWindowSize(width, height, handle = :current) ⇒ Object private
- #status ⇒ Object private
- #submitElement(element) ⇒ Object private
- #switchToDefaultContent ⇒ Object private
- #switchToFrame(id) ⇒ Object private
- #switchToParentFrame ⇒ Object private
- #switchToWindow(name) ⇒ Object private
- #touchDoubleTap(element) ⇒ Object private
- #touchDown(x, y) ⇒ Object private
- #touchElementFlick(element, right_by, down_by, speed) ⇒ Object private
- #touchFlick(xspeed, yspeed) ⇒ Object private
- #touchLongPress(element) ⇒ Object private
- #touchMove(x, y) ⇒ Object private
- #touchScroll(element, x, y) ⇒ Object private
- #touchSingleTap(element) ⇒ Object private
- #touchUp(x, y) ⇒ Object private
- #upload(local_file) ⇒ Object private
Methods included from BridgeHelper
#element_id_from, #parse_cookie_string, #unwrap_script_result
Constructor Details
#initialize(opts = {}) ⇒ Bridge
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.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 62 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) @file_detector = nil end |
Instance Attribute Details
#capabilities ⇒ Object (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.
52 53 54 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 52 def capabilities @capabilities end |
#context ⇒ Object
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.
51 52 53 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 51 def context @context end |
#file_detector ⇒ Object
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.
51 52 53 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 51 def file_detector @file_detector end |
#http ⇒ Object
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.
51 52 53 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 51 def http @http end |
Class Method Details
.command(name, verb, url) ⇒ Object
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.
47 48 49 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 47 def self.command(name, verb, url) COMMANDS[name] = [verb, url.freeze] end |
Instance Method Details
#acceptAlert ⇒ Object
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.
160 161 162 163 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 160 def acceptAlert command = :acceptAlert execute command end |
#addCookie(cookie) ⇒ Object
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
383 384 385 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 383 def addCookie() execute :addCookie, {}, :cookie => end |
#browser ⇒ Object
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.
92 93 94 95 96 97 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 92 def browser @browser ||= ( name = @capabilities.browser_name name ? name.gsub(" ", "_").to_sym : 'unknown' ) end |
#clearElement(element) ⇒ Object
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.
457 458 459 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 457 def clearElement(element) execute :clearElement, :id => element end |
#clearLocalStorage ⇒ Object
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.
311 312 313 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 311 def clearLocalStorage execute :clearLocalStorage end |
#clearSessionStorage ⇒ Object
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.
335 336 337 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 335 def clearSessionStorage execute :clearSessionStorage end |
#click ⇒ Object
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.
407 408 409 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 407 def click execute :click, {}, :button => 0 end |
#clickElement(element) ⇒ Object
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
403 404 405 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 403 def clickElement(element) execute :clickElement, :id => element end |
#close ⇒ Object
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.
240 241 242 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 240 def close execute :close end |
#contextClick ⇒ Object
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.
415 416 417 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 415 def contextClick execute :click, {}, :button => 2 end |
#create_session(desired_capabilities) ⇒ Object
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 124 125 126 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 121 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 |
#deleteAllCookies ⇒ Object
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.
395 396 397 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 395 def deleteAllCookies execute :deleteAllCookies end |
#deleteCookie(name) ⇒ Object
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.
387 388 389 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 387 def deleteCookie(name) execute :deleteCookie, :name => name end |
#dismissAlert ⇒ Object
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 168 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 165 def dismissAlert command = :dismissAlert execute command end |
#doubleClick ⇒ Object
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.
411 412 413 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 411 def doubleClick execute :doubleClick end |
#dragElement(element, right_by, down_by) ⇒ Object
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.
466 467 468 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 466 def dragElement(element, right_by, down_by) execute :dragElement, {:id => element}, :x => right_by, :y => down_by end |
#driver_extensions ⇒ Object
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.
99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 99 def driver_extensions [ DriverExtensions::HasInputDevices, DriverExtensions::UploadsFiles, DriverExtensions::TakesScreenshot, DriverExtensions::HasSessionId, DriverExtensions::Rotatable, DriverExtensions::HasTouchScreen, DriverExtensions::HasLocation, DriverExtensions::HasNetworkConnection, DriverExtensions::HasRemoteStatus ] end |
#elementEquals(element, other) ⇒ Object
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.
594 595 596 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 594 def elementEquals(element, other) element.ref == other.ref end |
#executeAsyncScript(script, *args) ⇒ Object
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 375 376 377 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 372 def executeAsyncScript(script, *args) assert_javascript_enabled result = execute :executeAsyncScript, {}, :script => script, :args => args unwrap_script_result result end |
#executeScript(script, *args) ⇒ Object
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
365 366 367 368 369 370 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 365 def executeScript(script, *args) assert_javascript_enabled result = execute :executeScript, {}, :script => script, :args => args unwrap_script_result result end |
#find_element_by(how, what, parent = nil) ⇒ Object
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.
607 608 609 610 611 612 613 614 615 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 607 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 |
#find_elements_by(how, what, parent = nil) ⇒ Object
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.
617 618 619 620 621 622 623 624 625 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 617 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 |
#get(url) ⇒ Object
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.
132 133 134 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 132 def get(url) execute :get, {}, :url => url end |
#getActiveElement ⇒ Object 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
602 603 604 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 602 def getActiveElement Element.new self, element_id_from(execute(:getActiveElement)) end |
#getAlert ⇒ Object
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
156 157 158 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 156 def getAlert execute :getAlert end |
#getAlertText ⇒ Object
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.
175 176 177 178 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 175 def getAlertText command = :getAlertText execute command end |
#getAllCookies ⇒ Object
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.
391 392 393 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 391 def getAllCookies execute :getCookies end |
#getAvailableLogTypes ⇒ Object
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
528 529 530 531 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 528 def getAvailableLogTypes types = execute :getAvailableLogTypes Array(types).map { |e| e.to_sym } end |
#getCapabilities ⇒ Object
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.
136 137 138 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 136 def getCapabilities Capabilities.json_create execute(:getCapabilities) end |
#getCurrentUrl ⇒ Object
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.
192 193 194 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 192 def getCurrentUrl execute :getCurrentUrl end |
#getCurrentWindowHandle ⇒ Object
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.
256 257 258 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 256 def getCurrentWindowHandle execute :getCurrentWindowHandle end |
#getElementAttribute(element, name) ⇒ Object
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.
549 550 551 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 549 def getElementAttribute(element, name) execute :getElementAttribute, :id => element, :name => name end |
#getElementLocation(element) ⇒ Object
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.
561 562 563 564 565 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 561 def getElementLocation(element) data = execute :getElementLocation, :id => element Point.new data['x'], data['y'] end |
#getElementLocationOnceScrolledIntoView(element) ⇒ Object
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.
567 568 569 570 571 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 567 def getElementLocationOnceScrolledIntoView(element) data = execute :getElementLocationOnceScrolledIntoView, :id => element Point.new data['x'], data['y'] end |
#getElementSize(element) ⇒ Object
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.
573 574 575 576 577 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 573 def getElementSize(element) data = execute :getElementSize, :id => element Dimension.new data['width'], data['height'] end |
#getElementTagName(element) ⇒ Object
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
545 546 547 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 545 def getElementTagName(element) execute :getElementTagName, :id => element end |
#getElementText(element) ⇒ Object
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.
557 558 559 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 557 def getElementText(element) execute :getElementText, :id => element end |
#getElementValue(element) ⇒ Object
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.
553 554 555 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 553 def getElementValue(element) execute :getElementValue, :id => element end |
#getElementValueOfCssProperty(element, prop) ⇒ Object
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.
590 591 592 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 590 def getElementValueOfCssProperty(element, prop) execute :getElementValueOfCssProperty, :id => element, :property_name => prop end |
#getLocalStorageItem(key) ⇒ Object
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
295 296 297 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 295 def getLocalStorageItem(key) execute :getLocalStorageItem, :key => key end |
#getLocalStorageKeys ⇒ Object
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.
303 304 305 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 303 def getLocalStorageKeys execute :getLocalStorageKeys end |
#getLocalStorageSize ⇒ Object
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.
315 316 317 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 315 def getLocalStorageSize execute :getLocalStorageSize end |
#getLocation ⇒ Object
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.
343 344 345 346 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 343 def getLocation obj = execute(:getLocation) || {} # android returns null Location.new obj['latitude'], obj['longitude'], obj['altitude'] end |
#getLog(type) ⇒ Object
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.
533 534 535 536 537 538 539 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 533 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 |
#getNetworkConnection ⇒ Object
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.
353 354 355 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 353 def getNetworkConnection execute :getNetworkConnection end |
#getPageSource ⇒ Object
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.
200 201 202 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 200 def getPageSource execute :getPageSource end |
#getScreenOrientation ⇒ Object
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.
520 521 522 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 520 def getScreenOrientation execute :getScreenOrientation end |
#getScreenshot ⇒ Object
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.
287 288 289 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 287 def getScreenshot execute :screenshot end |
#getSessionStorageItem(key) ⇒ Object
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.
319 320 321 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 319 def getSessionStorageItem(key) execute :getSessionStorageItem, :key => key end |
#getSessionStorageKeys ⇒ Object
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.
327 328 329 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 327 def getSessionStorageKeys execute :getSessionStorageKeys end |
#getSessionStorageSize ⇒ Object
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.
339 340 341 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 339 def getSessionStorageSize execute :getSessionStorageSize end |
#getTitle ⇒ Object
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.
196 197 198 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 196 def getTitle execute :getTitle end |
#getVisible ⇒ Object
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.
204 205 206 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 204 def getVisible execute :getVisible end |
#getWindowHandles ⇒ Object
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
252 253 254 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 252 def getWindowHandles execute :getWindowHandles end |
#getWindowPosition(handle = :current) ⇒ Object
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.
281 282 283 284 285 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 281 def getWindowPosition(handle = :current) data = execute :getWindowPosition, :window_handle => handle Point.new data['x'], data['y'] end |
#getWindowSize(handle = :current) ⇒ Object
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.
270 271 272 273 274 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 270 def getWindowSize(handle = :current) data = execute :getWindowSize, :window_handle => handle Dimension.new data['width'], data['height'] end |
#goBack ⇒ Object
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
184 185 186 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 184 def goBack execute :goBack end |
#goForward ⇒ Object
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.
188 189 190 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 188 def goForward execute :goForward end |
#isElementDisplayed(element) ⇒ Object
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.
587 588 589 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 587 def isElementDisplayed(element) execute :isElementDisplayed, :id => element end |
#isElementEnabled(element) ⇒ Object
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.
579 580 581 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 579 def isElementEnabled(element) execute :isElementEnabled, :id => element end |
#isElementSelected(element) ⇒ Object
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.
583 584 585 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 583 def isElementSelected(element) execute :isElementSelected, :id => element end |
#maximizeWindow(handle = :current) ⇒ Object
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.
266 267 268 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 266 def maximizeWindow(handle = :current) execute :maximizeWindow, :window_handle => handle end |
#mouseDown ⇒ Object
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.
419 420 421 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 419 def mouseDown execute :mouseDown end |
#mouseMoveTo(element, x = nil, y = nil) ⇒ Object
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 430 431 432 433 434 435 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 427 def mouseMoveTo(element, x = nil, y = nil) params = { :element => element } if x && y params.merge! :xoffset => x, :yoffset => y end execute :mouseMoveTo, {}, params end |
#mouseUp ⇒ Object
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.
423 424 425 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 423 def mouseUp execute :mouseUp end |
#quit ⇒ Object
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.
234 235 236 237 238 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 234 def quit execute :quit http.close rescue *QUIT_ERRORS end |
#refresh ⇒ Object
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.
244 245 246 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 244 def refresh execute :refresh end |
#removeLocalStorageItem(key) ⇒ Object
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.
299 300 301 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 299 def removeLocalStorageItem(key) execute :removeLocalStorageItem, :key => key end |
#removeSessionStorageItem(key) ⇒ Object
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.
323 324 325 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 323 def removeSessionStorageItem(key) execute :removeSessionStorageItem, :key => key end |
#sendKeysToActiveElement(key) ⇒ Object
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.
437 438 439 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 437 def sendKeysToActiveElement(key) execute :sendKeysToActiveElement, {}, :value => key end |
#sendKeysToElement(element, keys) ⇒ Object
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.
441 442 443 444 445 446 447 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 441 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 |
#session_id ⇒ Object
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.
117 118 119 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 117 def session_id @session_id || raise(Error::WebDriverError, "no current session exists") end |
#setAlertValue(keys) ⇒ Object
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.
170 171 172 173 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 170 def setAlertValue(keys) command = capabilities.browser_name == 'MicrosoftEdge' ? :setAlertValueW3C : :setAlertValue execute command, {}, :text => keys.to_s end |
#setImplicitWaitTimeout(milliseconds) ⇒ Object
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.
140 141 142 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 140 def setImplicitWaitTimeout(milliseconds) execute :implicitlyWait, {}, :ms => milliseconds end |
#setLocalStorageItem(key, value) ⇒ Object
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.
307 308 309 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 307 def setLocalStorageItem(key, value) execute :setLocalStorageItem, {}, :key => key, :value => value end |
#setLocation(lat, lon, alt) ⇒ Object
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.
348 349 350 351 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 348 def setLocation(lat, lon, alt) loc = {:latitude => lat, :longitude => lon, :altitude => alt} execute :setLocation, {}, :location => loc end |
#setNetworkConnection(type) ⇒ Object
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.
357 358 359 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 357 def setNetworkConnection(type) execute :setNetworkConnection, {}, :parameters => {:type => type} end |
#setScreenOrientation(orientation) ⇒ Object
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.
516 517 518 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 516 def setScreenOrientation(orientation) execute :setScreenOrientation, {}, :orientation => orientation end |
#setScriptTimeout(milliseconds) ⇒ Object
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.
144 145 146 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 144 def setScriptTimeout(milliseconds) execute :setScriptTimeout, {}, :ms => milliseconds end |
#setSessionStorageItem(key, value) ⇒ Object
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.
331 332 333 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 331 def setSessionStorageItem(key, value) execute :setSessionStorageItem, {}, :key => key, :value => value end |
#setTimeout(type, milliseconds) ⇒ Object
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.
148 149 150 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 148 def setTimeout(type, milliseconds) execute :setTimeout, {}, :type => type, :ms => milliseconds end |
#setVisible(bool) ⇒ Object
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.
208 209 210 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 208 def setVisible(bool) execute :setVisible, {}, bool end |
#setWindowPosition(x, y, handle = :current) ⇒ Object
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 279 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 276 def setWindowPosition(x, y, handle = :current) execute :setWindowPosition, {:window_handle => handle}, :x => x, :y => y end |
#setWindowSize(width, height, handle = :current) ⇒ Object
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.
260 261 262 263 264 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 260 def setWindowSize(width, height, handle = :current) execute :setWindowSize, {:window_handle => handle}, :width => width, :height => height end |
#status ⇒ Object
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.
128 129 130 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 128 def status execute :status end |
#submitElement(element) ⇒ Object
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.
462 463 464 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 462 def submitElement(element) execute :submitElement, :id => element end |
#switchToDefaultContent ⇒ Object
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.
228 229 230 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 228 def switchToDefaultContent execute :switchToFrame, {}, :id => nil end |
#switchToFrame(id) ⇒ Object
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.
220 221 222 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 220 def switchToFrame(id) execute :switchToFrame, {}, :id => id end |
#switchToParentFrame ⇒ Object
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.
224 225 226 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 224 def switchToParentFrame execute :switchToParentFrame end |
#switchToWindow(name) ⇒ Object
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.
212 213 214 215 216 217 218 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 212 def switchToWindow(name) if capabilities.browser_name == 'MicrosoftEdge' execute :switchToWindow, {}, :handle => name else execute :switchToWindow, {}, :name => name end end |
#touchDoubleTap(element) ⇒ Object
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.
474 475 476 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 474 def touchDoubleTap(element) execute :touchDoubleTap, {}, :element => element end |
#touchDown(x, y) ⇒ Object
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.
482 483 484 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 482 def touchDown(x, y) execute :touchDown, {}, :x => x, :y => y end |
#touchElementFlick(element, right_by, down_by, speed) ⇒ Object
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.
508 509 510 511 512 513 514 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 508 def touchElementFlick(element, right_by, down_by, speed) execute :touchFlick, {}, :element => element, :xoffset => right_by, :yoffset => down_by, :speed => speed end |
#touchFlick(xspeed, yspeed) ⇒ Object
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.
504 505 506 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 504 def touchFlick(xspeed, yspeed) execute :touchFlick, {}, :xspeed => xspeed, :yspeed => yspeed end |
#touchLongPress(element) ⇒ Object
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.
478 479 480 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 478 def touchLongPress(element) execute :touchLongPress, {}, :element => element end |
#touchMove(x, y) ⇒ Object
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.
490 491 492 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 490 def touchMove(x, y) execute :touchMove, {}, :x => x, :y => y end |
#touchScroll(element, x, y) ⇒ Object
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.
494 495 496 497 498 499 500 501 502 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 494 def touchScroll(element, x, y) if element execute :touchScroll, {}, :element => element, :xoffset => x, :yoffset => y else execute :touchScroll, {}, :xoffset => x, :yoffset => y end end |
#touchSingleTap(element) ⇒ Object
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.
470 471 472 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 470 def touchSingleTap(element) execute :touchSingleTap, {}, :element => element end |
#touchUp(x, y) ⇒ Object
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.
486 487 488 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 486 def touchUp(x, y) execute :touchUp, {}, :x => x, :y => y end |
#upload(local_file) ⇒ Object
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.
449 450 451 452 453 454 455 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 449 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 |