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
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 collapse
- 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
- #getPageSource ⇒ 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.
- #isBrowserOnline ⇒ Object private
- #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
- #setBrowserOnline(bool) ⇒ Object private
- #setImplicitWaitTimeout(milliseconds) ⇒ Object private
- #setLocalStorageItem(key, value) ⇒ Object private
- #setLocation(lat, lon, alt) ⇒ 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
- #submitElement(element) ⇒ Object private
- #switchToDefaultContent ⇒ Object private
- #switchToFrame(id) ⇒ 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.
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 '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
#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.
33 34 35 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 33 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.
32 33 34 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 32 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.
32 33 34 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 32 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.
32 33 34 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 32 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.
28 29 30 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 28 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.
130 131 132 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 130 def acceptAlert execute :acceptAlert 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
341 342 343 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 341 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.
71 72 73 74 75 76 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 71 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.
415 416 417 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 415 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.
269 270 271 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 269 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.
293 294 295 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 293 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.
365 366 367 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 365 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
361 362 363 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 361 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.
198 199 200 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 198 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.
373 374 375 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 373 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.
95 96 97 98 99 100 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 95 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.
353 354 355 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 353 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.
345 346 347 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 345 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.
134 135 136 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 134 def dismissAlert execute :dismissAlert 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.
369 370 371 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 369 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.
424 425 426 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 424 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.
78 79 80 81 82 83 84 85 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 78 def driver_extensions [ DriverExtensions::HasInputDevices, DriverExtensions::UploadsFiles, DriverExtensions::TakesScreenshot, DriverExtensions::HasSessionId ] 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.
544 545 546 547 548 549 550 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 544 def elementEquals(element, other) if element.ref == other.ref true else execute :elementEquals, :id => element.ref, :other => other.ref end 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.
330 331 332 333 334 335 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 330 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
323 324 325 326 327 328 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 323 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.
561 562 563 564 565 566 567 568 569 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 561 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.
571 572 573 574 575 576 577 578 579 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 571 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.
102 103 104 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 102 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
556 557 558 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 556 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
126 127 128 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 126 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.
142 143 144 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 142 def getAlertText execute :getAlertText 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.
349 350 351 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 349 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
478 479 480 481 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 478 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.
106 107 108 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 106 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.
158 159 160 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 158 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.
214 215 216 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 214 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.
499 500 501 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 499 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.
511 512 513 514 515 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 511 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.
517 518 519 520 521 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 517 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.
523 524 525 526 527 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 523 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
495 496 497 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 495 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.
507 508 509 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 507 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.
503 504 505 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 503 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.
540 541 542 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 540 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
253 254 255 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 253 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.
261 262 263 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 261 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.
273 274 275 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 273 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.
301 302 303 304 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 301 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.
483 484 485 486 487 488 489 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 483 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 |
#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.
166 167 168 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 166 def getPageSource execute :getPageSource 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.
245 246 247 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 245 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.
277 278 279 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 277 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.
285 286 287 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 285 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.
297 298 299 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 297 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.
162 163 164 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 162 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.
170 171 172 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 170 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
210 211 212 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 210 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.
239 240 241 242 243 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 239 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.
228 229 230 231 232 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 228 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
150 151 152 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 150 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.
154 155 156 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 154 def goForward execute :goForward end |
#isBrowserOnline ⇒ 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 isBrowserOnline execute :isBrowserOnline 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.
537 538 539 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 537 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.
529 530 531 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 529 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.
533 534 535 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 533 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.
224 225 226 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 224 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.
377 378 379 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 377 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.
385 386 387 388 389 390 391 392 393 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 385 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.
381 382 383 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 381 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.
192 193 194 195 196 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 192 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.
202 203 204 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 202 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.
257 258 259 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 257 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.
281 282 283 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 281 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.
395 396 397 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 395 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.
399 400 401 402 403 404 405 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 399 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.
91 92 93 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 91 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.
138 139 140 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 138 def setAlertValue(keys) execute :setAlertValue, {}, :text => keys.to_s end |
#setBrowserOnline(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.
315 316 317 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 315 def setBrowserOnline(bool) execute :setBrowserOnline, {}, :state => bool 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.
110 111 112 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 110 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.
265 266 267 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 265 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.
306 307 308 309 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 306 def setLocation(lat, lon, alt) loc = {:latitude => lat, :longitude => lon, :altitude => alt} execute :setLocation, {}, :location => loc 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.
114 115 116 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 114 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.
289 290 291 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 289 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.
118 119 120 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 118 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.
174 175 176 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 174 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.
234 235 236 237 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 234 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.
218 219 220 221 222 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 218 def setWindowSize(width, height, handle = :current) execute :setWindowSize, {:window_handle => handle}, :width => width, :height => height 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.
420 421 422 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 420 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.
186 187 188 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 186 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.
182 183 184 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 182 def switchToFrame(id) execute :switchToFrame, {}, :id => id 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.
178 179 180 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 178 def switchToWindow(name) execute :switchToWindow, {}, :name => name 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.
432 433 434 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 432 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.
440 441 442 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 440 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.
466 467 468 469 470 471 472 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 466 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.
462 463 464 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 462 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.
436 437 438 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 436 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.
448 449 450 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 448 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.
452 453 454 455 456 457 458 459 460 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 452 def touchScroll(element, x, y) if element execute :touchScroll, {}, :xoffset => x, :yoffset => y else execute :touchScroll, {}, :element => element, :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.
428 429 430 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 428 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.
444 445 446 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 444 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.
407 408 409 410 411 412 413 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 407 def upload(local_file) unless File.file?(local_file) raise WebDriverError::Error, "you may only upload files: #{local_file.inspect}" end execute :uploadFile, {}, :file => Zipper.zip_file(local_file) end |