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
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
- #browser ⇒ Object private
- #clearElement(element) ⇒ Object private
- #click ⇒ Object private
- #clickElement(element) ⇒ Object private
- #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
- #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
-
#getAlert ⇒ Object
private
alerts.
- #getAlertText ⇒ Object private
- #getAllCookies ⇒ Object private
- #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
- #getElementText(element) ⇒ Object private
- #getElementValue(element) ⇒ Object private
- #getElementValueOfCssProperty(element, prop) ⇒ Object private
- #getPageSource ⇒ Object private
- #getScreenOrientation ⇒ Object private
- #getScreenshot ⇒ Object private
- #getTitle ⇒ Object private
- #getVisible ⇒ Object private
- #getWindowHandles ⇒ Object private
- #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
- #mouseDown ⇒ Object private
- #mouseMoveTo(element, x = nil, y = nil) ⇒ Object private
- #mouseUp ⇒ Object private
- #quit ⇒ Object private
- #refresh ⇒ Object private
- #sendKeysToActiveElement(key) ⇒ Object private
- #sendKeysToElement(element, keys) ⇒ Object private
-
#session_id ⇒ Object
private
Returns the current session ID.
- #setAlertValue(keys) ⇒ Object private
- #setElementSelected(element) ⇒ Object private
- #setImplicitWaitTimeout(milliseconds) ⇒ Object private
- #setScreenOrientation(orientation) ⇒ Object private
- #setScriptTimeout(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
- #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.
123 124 125 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 123 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.
248 249 250 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 248 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 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 71 def browser @browser ||= @capabilities.browser_name.gsub(" ", "_").to_sym 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.
352 353 354 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 352 def clearElement(element) execute :clearElement, :id => element 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.
268 269 270 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 268 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.
264 265 266 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 264 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.
191 192 193 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 191 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.
276 277 278 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 276 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.
92 93 94 95 96 97 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 92 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.
260 261 262 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 260 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.
252 253 254 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 252 def deleteCookie(name) execute :deleteCookieNamed, :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.
127 128 129 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 127 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.
272 273 274 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 272 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.
385 386 387 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 385 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.
75 76 77 78 79 80 81 82 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 75 def driver_extensions [ DriverExtensions::HasInputDevices, DriverExtensions::UploadsFiles, DriverExtensions::TakesScreenshot, DriverExtensions::Rotatable ] 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.
389 390 391 392 393 394 395 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 389 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.
241 242 243 244 245 246 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 241 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.
234 235 236 237 238 239 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 234 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.
397 398 399 400 401 402 403 404 405 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 397 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.
407 408 409 410 411 412 413 414 415 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 407 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.
99 100 101 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 99 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.
380 381 382 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 380 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
119 120 121 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 119 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.
135 136 137 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 135 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.
256 257 258 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 256 def getAllCookies execute :getAllCookies 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.
103 104 105 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 103 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.
151 152 153 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 151 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.
203 204 205 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 203 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.
306 307 308 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 306 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.
318 319 320 321 322 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 318 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.
324 325 326 327 328 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 324 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.
330 331 332 333 334 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 330 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.
302 303 304 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 302 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.
314 315 316 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 314 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.
310 311 312 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 310 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.
376 377 378 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 376 def getElementValueOfCssProperty(element, prop) execute :getElementValueOfCssProperty, :id => element, :property_name => prop 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.
159 160 161 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 159 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.
421 422 423 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 421 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.
230 231 232 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 230 def getScreenshot execute :screenshot 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.
155 156 157 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 155 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.
163 164 165 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 163 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.
199 200 201 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 199 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.
224 225 226 227 228 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 224 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.
213 214 215 216 217 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 213 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
143 144 145 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 143 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.
147 148 149 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 147 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.
364 365 366 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 364 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.
356 357 358 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 356 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.
360 361 362 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 360 def isElementSelected(element) execute :isElementSelected, :id => element 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.
280 281 282 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 280 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.
288 289 290 291 292 293 294 295 296 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 288 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.
284 285 286 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 284 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.
185 186 187 188 189 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 185 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.
195 196 197 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 195 def refresh execute :refresh 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.
298 299 300 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 298 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.
336 337 338 339 340 341 342 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 336 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.
88 89 90 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 88 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.
131 132 133 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 131 def setAlertValue(keys) execute :setAlertValue, {}, :text => keys.to_s end |
#setElementSelected(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.
372 373 374 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 372 def setElementSelected(element) execute :setElementSelected, :id => element 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.
107 108 109 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 107 def setImplicitWaitTimeout(milliseconds) execute :setImplicitWaitTimeout, {}, :ms => milliseconds 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.
417 418 419 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 417 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.
111 112 113 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 111 def setScriptTimeout(milliseconds) execute :setScriptTimeout, {}, :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.
167 168 169 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 167 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.
219 220 221 222 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 219 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.
207 208 209 210 211 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 207 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.
368 369 370 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 368 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.
179 180 181 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 179 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.
175 176 177 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 175 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.
171 172 173 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 171 def switchToWindow(name) execute :switchToWindow, {}, :name => name 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.
344 345 346 347 348 349 350 |
# File 'lib/selenium/webdriver/remote/bridge.rb', line 344 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 |