Class: Selenium::WebDriver::Remote::Bridge Private

Inherits:
Object
  • Object
show all
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.

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

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • url (String)

    url for the remote server

  • http_client (Object)

    an HTTP client instance that implements the same protocol as Http::Default

  • desired_capabilities (Capabilities)

    an instance of Remote::Capabilities describing the capabilities you want



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

#capabilitiesObject (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

#contextObject

This method is 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_detectorObject

This method is 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

#httpObject

This method is 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.

Parameters:

  • name (Symbol)

    name of the resulting method

  • url (String)

    a URL template, which can include some arguments, much like the definitions on the server. the :session_id parameter is implicitly handled, but the remainder will become required method arguments.

  • verb (Symbol)

    the appropriate http verb, such as :get, :post, or :delete



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

#acceptAlertObject

This method is 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 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



343
344
345
# File 'lib/selenium/webdriver/remote/bridge.rb', line 343

def addCookie(cookie)
  execute :addCookie, {}, :cookie => cookie
end

#browserObject

This method is 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.



417
418
419
# File 'lib/selenium/webdriver/remote/bridge.rb', line 417

def clearElement(element)
  execute :clearElement, :id => element
end

#clearLocalStorageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



271
272
273
# File 'lib/selenium/webdriver/remote/bridge.rb', line 271

def clearLocalStorage
  execute :clearLocalStorage
end

#clearSessionStorageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



295
296
297
# File 'lib/selenium/webdriver/remote/bridge.rb', line 295

def clearSessionStorage
  execute :clearSessionStorage
end

#clickObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



367
368
369
# File 'lib/selenium/webdriver/remote/bridge.rb', line 367

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



363
364
365
# File 'lib/selenium/webdriver/remote/bridge.rb', line 363

def clickElement(element)
  execute :clickElement, :id => element
end

#closeObject

This method is 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 close
  execute :close
end

#contextClickObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



375
376
377
# File 'lib/selenium/webdriver/remote/bridge.rb', line 375

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.



97
98
99
100
101
102
# File 'lib/selenium/webdriver/remote/bridge.rb', line 97

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

#deleteAllCookiesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



355
356
357
# File 'lib/selenium/webdriver/remote/bridge.rb', line 355

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.



347
348
349
# File 'lib/selenium/webdriver/remote/bridge.rb', line 347

def deleteCookie(name)
  execute :deleteCookie, :name => name
end

#dismissAlertObject

This method is 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 dismissAlert
  execute :dismissAlert
end

#doubleClickObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



371
372
373
# File 'lib/selenium/webdriver/remote/bridge.rb', line 371

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.



426
427
428
# File 'lib/selenium/webdriver/remote/bridge.rb', line 426

def dragElement(element, right_by, down_by)
  execute :dragElement, {:id => element}, :x => right_by, :y => down_by
end

#driver_extensionsObject

This method is 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
# File 'lib/selenium/webdriver/remote/bridge.rb', line 78

def driver_extensions
  [
    DriverExtensions::HasInputDevices,
    DriverExtensions::UploadsFiles,
    DriverExtensions::TakesScreenshot,
    DriverExtensions::HasSessionId,
    DriverExtensions::Rotatable,
    DriverExtensions::HasTouchScreen
  ]
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.



554
555
556
557
558
559
560
# File 'lib/selenium/webdriver/remote/bridge.rb', line 554

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.



332
333
334
335
336
337
# File 'lib/selenium/webdriver/remote/bridge.rb', line 332

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



325
326
327
328
329
330
# File 'lib/selenium/webdriver/remote/bridge.rb', line 325

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.



571
572
573
574
575
576
577
578
579
# File 'lib/selenium/webdriver/remote/bridge.rb', line 571

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.



581
582
583
584
585
586
587
588
589
# File 'lib/selenium/webdriver/remote/bridge.rb', line 581

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.



104
105
106
# File 'lib/selenium/webdriver/remote/bridge.rb', line 104

def get(url)
  execute :get, {}, :url => url
end

#getActiveElementObject 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



566
567
568
# File 'lib/selenium/webdriver/remote/bridge.rb', line 566

def getActiveElement
  Element.new self, element_id_from(execute(:getActiveElement))
end

#getAlertObject

This method is 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



128
129
130
# File 'lib/selenium/webdriver/remote/bridge.rb', line 128

def getAlert
  execute :getAlert
end

#getAlertTextObject

This method is 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 getAlertText
  execute :getAlertText
end

#getAllCookiesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



351
352
353
# File 'lib/selenium/webdriver/remote/bridge.rb', line 351

def getAllCookies
  execute :getCookies
end

#getAvailableLogTypesObject

This method is 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



488
489
490
491
# File 'lib/selenium/webdriver/remote/bridge.rb', line 488

def getAvailableLogTypes
  types = execute :getAvailableLogTypes
  Array(types).map { |e| e.to_sym }
end

#getCapabilitiesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



108
109
110
# File 'lib/selenium/webdriver/remote/bridge.rb', line 108

def getCapabilities
  Capabilities.json_create execute(:getCapabilities)
end

#getCurrentUrlObject

This method is 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
# File 'lib/selenium/webdriver/remote/bridge.rb', line 160

def getCurrentUrl
  execute :getCurrentUrl
end

#getCurrentWindowHandleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



216
217
218
# File 'lib/selenium/webdriver/remote/bridge.rb', line 216

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.



509
510
511
# File 'lib/selenium/webdriver/remote/bridge.rb', line 509

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.



521
522
523
524
525
# File 'lib/selenium/webdriver/remote/bridge.rb', line 521

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.



527
528
529
530
531
# File 'lib/selenium/webdriver/remote/bridge.rb', line 527

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.



533
534
535
536
537
# File 'lib/selenium/webdriver/remote/bridge.rb', line 533

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



505
506
507
# File 'lib/selenium/webdriver/remote/bridge.rb', line 505

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.



517
518
519
# File 'lib/selenium/webdriver/remote/bridge.rb', line 517

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.



513
514
515
# File 'lib/selenium/webdriver/remote/bridge.rb', line 513

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.



550
551
552
# File 'lib/selenium/webdriver/remote/bridge.rb', line 550

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



255
256
257
# File 'lib/selenium/webdriver/remote/bridge.rb', line 255

def getLocalStorageItem(key)
  execute :getLocalStorageItem, :key => key
end

#getLocalStorageKeysObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



263
264
265
# File 'lib/selenium/webdriver/remote/bridge.rb', line 263

def getLocalStorageKeys
  execute :getLocalStorageKeys
end

#getLocalStorageSizeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



275
276
277
# File 'lib/selenium/webdriver/remote/bridge.rb', line 275

def getLocalStorageSize
  execute :getLocalStorageSize
end

#getLocationObject

This method is 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
306
# File 'lib/selenium/webdriver/remote/bridge.rb', line 303

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.



493
494
495
496
497
498
499
# File 'lib/selenium/webdriver/remote/bridge.rb', line 493

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

#getPageSourceObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



168
169
170
# File 'lib/selenium/webdriver/remote/bridge.rb', line 168

def getPageSource
  execute :getPageSource
end

#getScreenOrientationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



480
481
482
# File 'lib/selenium/webdriver/remote/bridge.rb', line 480

def getScreenOrientation
  execute :getScreenOrientation
end

#getScreenshotObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



247
248
249
# File 'lib/selenium/webdriver/remote/bridge.rb', line 247

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.



279
280
281
# File 'lib/selenium/webdriver/remote/bridge.rb', line 279

def getSessionStorageItem(key)
  execute :getSessionStorageItem, :key => key
end

#getSessionStorageKeysObject

This method is 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 getSessionStorageKeys
  execute :getSessionStorageKeys
end

#getSessionStorageSizeObject

This method is 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 getSessionStorageSize
  execute :getSessionStorageSize
end

#getTitleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



164
165
166
# File 'lib/selenium/webdriver/remote/bridge.rb', line 164

def getTitle
  execute :getTitle
end

#getVisibleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



172
173
174
# File 'lib/selenium/webdriver/remote/bridge.rb', line 172

def getVisible
  execute :getVisible
end

#getWindowHandlesObject

This method is 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



212
213
214
# File 'lib/selenium/webdriver/remote/bridge.rb', line 212

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.



241
242
243
244
245
# File 'lib/selenium/webdriver/remote/bridge.rb', line 241

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.



230
231
232
233
234
# File 'lib/selenium/webdriver/remote/bridge.rb', line 230

def getWindowSize(handle = :current)
  data = execute :getWindowSize, :window_handle => handle

  Dimension.new data['width'], data['height']
end

#goBackObject

This method is 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



152
153
154
# File 'lib/selenium/webdriver/remote/bridge.rb', line 152

def goBack
  execute :goBack
end

#goForwardObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



156
157
158
# File 'lib/selenium/webdriver/remote/bridge.rb', line 156

def goForward
  execute :goForward
end

#isBrowserOnlineObject

This method is 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
# File 'lib/selenium/webdriver/remote/bridge.rb', line 313

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.



547
548
549
# File 'lib/selenium/webdriver/remote/bridge.rb', line 547

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.



539
540
541
# File 'lib/selenium/webdriver/remote/bridge.rb', line 539

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.



543
544
545
# File 'lib/selenium/webdriver/remote/bridge.rb', line 543

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.



226
227
228
# File 'lib/selenium/webdriver/remote/bridge.rb', line 226

def maximizeWindow(handle = :current)
  execute :maximizeWindow, :window_handle => handle
end

#mouseDownObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



379
380
381
# File 'lib/selenium/webdriver/remote/bridge.rb', line 379

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.



387
388
389
390
391
392
393
394
395
# File 'lib/selenium/webdriver/remote/bridge.rb', line 387

def mouseMoveTo(element, x = nil, y = nil)
  params = { :element => element }

  if x && y
    params.merge! :xoffset => x, :yoffset => y
  end

  execute :mouseMoveTo, {}, params
end

#mouseUpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



383
384
385
# File 'lib/selenium/webdriver/remote/bridge.rb', line 383

def mouseUp
  execute :mouseUp
end

#quitObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



194
195
196
197
198
# File 'lib/selenium/webdriver/remote/bridge.rb', line 194

def quit
  execute :quit
  http.close
rescue *QUIT_ERRORS
end

#refreshObject

This method is 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 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.



259
260
261
# File 'lib/selenium/webdriver/remote/bridge.rb', line 259

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.



283
284
285
# File 'lib/selenium/webdriver/remote/bridge.rb', line 283

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.



397
398
399
# File 'lib/selenium/webdriver/remote/bridge.rb', line 397

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.



401
402
403
404
405
406
407
# File 'lib/selenium/webdriver/remote/bridge.rb', line 401

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_idObject

This method is 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.



93
94
95
# File 'lib/selenium/webdriver/remote/bridge.rb', line 93

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.



140
141
142
# File 'lib/selenium/webdriver/remote/bridge.rb', line 140

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.



317
318
319
# File 'lib/selenium/webdriver/remote/bridge.rb', line 317

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.



112
113
114
# File 'lib/selenium/webdriver/remote/bridge.rb', line 112

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.



267
268
269
# File 'lib/selenium/webdriver/remote/bridge.rb', line 267

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.



308
309
310
311
# File 'lib/selenium/webdriver/remote/bridge.rb', line 308

def setLocation(lat, lon, alt)
  loc = {:latitude => lat, :longitude => lon, :altitude => alt}
  execute :setLocation, {}, :location => loc
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.



476
477
478
# File 'lib/selenium/webdriver/remote/bridge.rb', line 476

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.



116
117
118
# File 'lib/selenium/webdriver/remote/bridge.rb', line 116

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.



291
292
293
# File 'lib/selenium/webdriver/remote/bridge.rb', line 291

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.



120
121
122
# File 'lib/selenium/webdriver/remote/bridge.rb', line 120

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.



176
177
178
# File 'lib/selenium/webdriver/remote/bridge.rb', line 176

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.



236
237
238
239
# File 'lib/selenium/webdriver/remote/bridge.rb', line 236

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.



220
221
222
223
224
# File 'lib/selenium/webdriver/remote/bridge.rb', line 220

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.



422
423
424
# File 'lib/selenium/webdriver/remote/bridge.rb', line 422

def submitElement(element)
  execute :submitElement, :id => element
end

#switchToDefaultContentObject

This method is 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 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.



184
185
186
# File 'lib/selenium/webdriver/remote/bridge.rb', line 184

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.



180
181
182
# File 'lib/selenium/webdriver/remote/bridge.rb', line 180

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.



434
435
436
# File 'lib/selenium/webdriver/remote/bridge.rb', line 434

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.



442
443
444
# File 'lib/selenium/webdriver/remote/bridge.rb', line 442

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.



468
469
470
471
472
473
474
# File 'lib/selenium/webdriver/remote/bridge.rb', line 468

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.



464
465
466
# File 'lib/selenium/webdriver/remote/bridge.rb', line 464

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.



438
439
440
# File 'lib/selenium/webdriver/remote/bridge.rb', line 438

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.



450
451
452
# File 'lib/selenium/webdriver/remote/bridge.rb', line 450

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.



454
455
456
457
458
459
460
461
462
# File 'lib/selenium/webdriver/remote/bridge.rb', line 454

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.



430
431
432
# File 'lib/selenium/webdriver/remote/bridge.rb', line 430

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.



446
447
448
# File 'lib/selenium/webdriver/remote/bridge.rb', line 446

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.



409
410
411
412
413
414
415
# File 'lib/selenium/webdriver/remote/bridge.rb', line 409

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