Class: Selenium::WebDriver::IE::Bridge
- Inherits:
-
Object
- Object
- Selenium::WebDriver::IE::Bridge
- Includes:
- Util
- Defined in:
- lib/selenium/webdriver/ie/bridge.rb
Constant Summary
Constants included from Util
Util::CP_ACP, Util::CP_MACCP, Util::CP_OEMCP, Util::CP_SYMBOL, Util::CP_THREAD_ACP, Util::CP_UTF7, Util::CP_UTF8
Instance Method Summary collapse
-
#addCookie(opts) ⇒ Object
Configuration.
- #browser ⇒ Object
- #clearElement(element_pointer) ⇒ Object
-
#clickElement(element_pointer) ⇒ Object
Element functions.
- #close ⇒ Object
- #deleteAllCookies ⇒ Object
- #deleteCookie(name) ⇒ Object
- #dragElement(element_pointer, right_by, down_by) ⇒ Object
- #driver_extensions ⇒ Object
- #elementEquals(element, other) ⇒ Object
- #executeScript(script, *args) ⇒ Object
- #finalize(element_pointer) ⇒ Object
-
#findElementByClassName(parent, class_name) ⇒ Object
Finders.
- #findElementById(parent, id) ⇒ Object
- #findElementByLinkText(parent, link_text) ⇒ Object
- #findElementByName(parent, name) ⇒ Object
- #findElementByPartialLinkText(parent, link_text) ⇒ Object
- #findElementByTagName(parent, tag_name) ⇒ Object
- #findElementByXpath(parent, xpath) ⇒ Object
- #findElementsByClassName(parent, class_name) ⇒ Object
- #findElementsById(parent, id) ⇒ Object
- #findElementsByLinkText(parent, link_text) ⇒ Object
- #findElementsByName(parent, name) ⇒ Object
- #findElementsByPartialLinkText(parent, link_text) ⇒ Object
- #findElementsByTagName(parent, tag_name) ⇒ Object
- #findElementsByXpath(parent, xpath) ⇒ Object
- #get(url) ⇒ Object
- #getAllCookies ⇒ Object
- #getBrowserVisible ⇒ Object
- #getCurrentUrl ⇒ Object
- #getCurrentWindowHandle ⇒ Object
- #getElementAttribute(element_pointer, name) ⇒ Object
- #getElementLocation(element_pointer) ⇒ Object
- #getElementSize(element_pointer) ⇒ Object
- #getElementTagName(element_pointer) ⇒ Object
- #getElementText(element_pointer) ⇒ Object
- #getElementValue(element_pointer) ⇒ Object
- #getElementValueOfCssProperty(element_pointer, prop) ⇒ Object
- #getPageSource ⇒ Object
- #getSpeed ⇒ Object
- #getTitle ⇒ Object
- #getWindowHandles ⇒ Object
- #goBack ⇒ Object
- #goForward ⇒ Object
- #hoverOverElement(element_pointer) ⇒ Object
-
#initialize ⇒ Bridge
constructor
A new instance of Bridge.
- #isElementDisplayed(element_pointer) ⇒ Object
- #isElementEnabled(element_pointer) ⇒ Object
- #isElementSelected(element_pointer) ⇒ Object
- #quit ⇒ Object
- #refresh ⇒ Object
- #sendKeysToElement(element_pointer, string) ⇒ Object
- #setBrowserVisible(bool) ⇒ Object
- #setElementSelected(element_pointer) ⇒ Object
- #setImplicitWaitTimeout(milliseconds) ⇒ Object
- #setSpeed(speed) ⇒ Object
- #submitElement(element_pointer) ⇒ Object
- #switchToActiveElement ⇒ Object
- #switchToDefaultContent ⇒ Object
- #switchToFrame(id) ⇒ Object
- #switchToWindow(id) ⇒ Object
- #toggleElement(element_pointer) ⇒ Object
- #waitForLoadToComplete ⇒ Object
Methods included from Util
#create_element, #create_element_collection, #create_string, #extract_elements_from, #extract_string_from, #string_array_from, #wstring_ptr, #wstring_to_bytestring
Constructor Details
#initialize ⇒ Bridge
Returns a new instance of Bridge.
12 13 14 15 16 17 18 19 20 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 12 def initialize ptr_ref = FFI::MemoryPointer.new :pointer check_error_code Lib.wdNewDriverInstance(ptr_ref), "could not create driver instance" @driver_pointer = ptr_ref.get_pointer(0) @speed = :fast end |
Instance Method Details
#addCookie(opts) ⇒ Object
Configuration
176 177 178 179 180 181 182 183 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 176 def addCookie(opts) = "#{opts[:name]}=#{opts[:value]}; " << "path=#{opts[:path]}; " if opts[:path] && !opts[:path].empty? << "domain=#{opts[:domain][/^(.+?):/, 1]};" if opts[:domain] && !opts[:domain].empty? check_error_code Lib.wdAddCookie(@driver_pointer, wstring_ptr()), "unable to add cookie" end |
#browser ⇒ Object
22 23 24 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 22 def browser :internet_explorer end |
#clearElement(element_pointer) ⇒ Object
372 373 374 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 372 def clearElement(element_pointer) check_error_code Lib.wdeClear(element_pointer), "unable to clear element" end |
#clickElement(element_pointer) ⇒ Object
Element functions
334 335 336 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 334 def clickElement(element_pointer) check_error_code Lib.wdeClick(element_pointer), "unable to click element" end |
#close ⇒ Object
122 123 124 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 122 def close check_error_code Lib.wdClose(@driver_pointer), "unable to close driver" end |
#deleteAllCookies ⇒ Object
209 210 211 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 209 def deleteAllCookies raise NotImplementedError, "missing from IE driver" end |
#deleteCookie(name) ⇒ Object
205 206 207 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 205 def deleteCookie(name) raise NotImplementedError, "missing from IE driver" end |
#dragElement(element_pointer, right_by, down_by) ⇒ Object
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 444 def dragElement(element_pointer, right_by, down_by) # TODO: check return values? hwnd = FFI::MemoryPointer.new :pointer x, y, width, height = Array.new(4) { FFI::MemoryPointer.new :long } check_error_code Lib.wdeGetDetailsOnceScrolledOnToScreen(element_pointer, hwnd, x, y, width, height), "unable to determine location once scrolled on to screen" Lib.wdeMouseDownAt(hwnd.get_pointer(0), x.get_long(0), y.get_long(0)) destination_x = x.get_long(0) + right_by destination_y = y.get_long(0) + down_by duration = 500 # TODO: parent.manage().getSpeed().getTimeOut(); Lib.wdeMouseMoveTo(hwnd.get_pointer(0), duration, x.get_long(0), y.get_long(0), destination_x, destination_y) Lib.wdeMouseUpAt(hwnd.get_pointer(0), destination_x, destination_y) ensure [hwnd, x, y, width, height].each { |pointer| pointer.free } end |
#driver_extensions ⇒ Object
26 27 28 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 26 def driver_extensions [] end |
#elementEquals(element, other) ⇒ Object
440 441 442 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 440 def elementEquals(element, other) executeScript "return arguments[0] === arguments[1]", element, other end |
#executeScript(script, *args) ⇒ Object
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 146 def executeScript(script, *args) script_args_ref = FFI::MemoryPointer.new :pointer result = Lib.wdNewScriptArgs(script_args_ref, args.size) check_error_code result, "unable to create new script arguments array" args_pointer = script_args_ref.get_pointer(0) populate_arguments(result, args_pointer, args) script = "(function() { return function(){" + script + "};})();" script_result_ref = FFI::MemoryPointer.new :pointer check_error_code Lib.wdExecuteScript(@driver_pointer, wstring_ptr(script), args_pointer, script_result_ref), "Cannot execute script" extract_return_value script_result_ref ensure script_args_ref.free script_result_ref.free if script_result_ref Lib.wdFreeScriptArgs(args_pointer) if args_pointer end |
#finalize(element_pointer) ⇒ Object
488 489 490 491 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 488 def finalize(element_pointer) check_error_code Lib.wdeFreeElement(element_pointer), "unable to finalize #{element_pointer} for #{self}" end |
#findElementByClassName(parent, class_name) ⇒ Object
Finders
225 226 227 228 229 230 231 232 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 225 def findElementByClassName(parent, class_name) # TODO: argument checks create_element do |raw_element| check_error_code Lib.wdFindElementByClassName(@driver_pointer, parent, wstring_ptr(class_name), raw_element), "unable to find element by class name using #{class_name.inspect}" end end |
#findElementById(parent, id) ⇒ Object
243 244 245 246 247 248 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 243 def findElementById(parent, id) create_element do |raw_element| check_error_code Lib.wdFindElementById(@driver_pointer, parent, wstring_ptr(id), raw_element), "unable to find element by id using #{id.inspect}" end end |
#findElementByLinkText(parent, link_text) ⇒ Object
257 258 259 260 261 262 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 257 def findElementByLinkText(parent, link_text) create_element do |raw_element| check_error_code Lib.wdFindElementByLinkText(@driver_pointer, parent, wstring_ptr(link_text), raw_element), "unable to find element by link text using #{link_text.inspect}" end end |
#findElementByName(parent, name) ⇒ Object
285 286 287 288 289 290 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 285 def findElementByName(parent, name) create_element do |raw_element| check_error_code Lib.wdFindElementByName(@driver_pointer, parent, wstring_ptr(name), raw_element), "unable to find element by name using #{name.inspect}" end end |
#findElementByPartialLinkText(parent, link_text) ⇒ Object
271 272 273 274 275 276 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 271 def findElementByPartialLinkText(parent, link_text) create_element do |raw_element| check_error_code Lib.wdFindElementByPartialLinkText(@driver_pointer, parent, wstring_ptr(link_text), raw_element), "unable to find element by partial link text using #{link_text.inspect}" end end |
#findElementByTagName(parent, tag_name) ⇒ Object
299 300 301 302 303 304 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 299 def findElementByTagName(parent, tag_name) create_element do |raw_element| check_error_code Lib.wdFindElementByTagName(@driver_pointer, parent, wstring_ptr(tag_name), raw_element), "unable to find element by tag name using #{tag_name.inspect}" end end |
#findElementByXpath(parent, xpath) ⇒ Object
313 314 315 316 317 318 319 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 313 def findElementByXpath(parent, xpath) create_element do |raw_element| check_error_code Lib.wdFindElementByXPath(@driver_pointer, parent, wstring_ptr(xpath), raw_element), "unable to find element by xpath using #{xpath.inspect}" # TODO: Additional error handling end end |
#findElementsByClassName(parent, class_name) ⇒ Object
234 235 236 237 238 239 240 241 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 234 def findElementsByClassName(parent, class_name) # TODO: argument checks create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsByClassName(@driver_pointer, parent, wstring_ptr(class_name), raw_elements), "unable to find elements by class name using #{class_name.inspect}" end end |
#findElementsById(parent, id) ⇒ Object
250 251 252 253 254 255 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 250 def findElementsById(parent, id) create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsById(@driver_pointer, parent, wstring_ptr(id), raw_elements), "unable to find elements by id using #{id.inspect}" end end |
#findElementsByLinkText(parent, link_text) ⇒ Object
264 265 266 267 268 269 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 264 def findElementsByLinkText(parent, link_text) create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsByLinkText(@driver_pointer, parent, wstring_ptr(link_text), raw_elements), "unable to find elements by link text using #{link_text.inspect}" end end |
#findElementsByName(parent, name) ⇒ Object
292 293 294 295 296 297 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 292 def findElementsByName(parent, name) create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsByName(@driver_pointer, parent, wstring_ptr(name), raw_elements), "unable to find elements by name using #{name.inspect}" end end |
#findElementsByPartialLinkText(parent, link_text) ⇒ Object
278 279 280 281 282 283 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 278 def findElementsByPartialLinkText(parent, link_text) create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsByPartialLinkText(@driver_pointer, parent, wstring_ptr(link_text), raw_elements), "unable to find elements by partial link text using #{link_text.inspect}" end end |
#findElementsByTagName(parent, tag_name) ⇒ Object
306 307 308 309 310 311 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 306 def findElementsByTagName(parent, tag_name) create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsByTagName(@driver_pointer, parent, wstring_ptr(tag_name), raw_elements), "unable to find elements by tag name using #{tag_name.inspect}" end end |
#findElementsByXpath(parent, xpath) ⇒ Object
321 322 323 324 325 326 327 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 321 def findElementsByXpath(parent, xpath) create_element_collection do |raw_elements| check_error_code Lib.wdFindElementsByXPath(@driver_pointer, parent, wstring_ptr(xpath), raw_elements), "unable to find elements by xpath using #{xpath.inspect}" # TODO: Additional error handling end end |
#get(url) ⇒ Object
30 31 32 33 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 30 def get(url) check_error_code Lib.wdGet(@driver_pointer, wstring_ptr(url)), "Cannot get url #{url.inspect}" end |
#getAllCookies ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 185 def getAllCookies str = create_string do |wrapper| check_error_code Lib.wdGetCookies(@driver_pointer, wrapper), "unable to get cookies" end str.split("; ").map do || parts = .split("=") next unless parts.size == 2 { 'name' => parts[0], 'value' => parts[1], 'domain' => getCurrentUrl, 'path' => "", 'expires' => nil, 'secure' => false } end.compact end |
#getBrowserVisible ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 66 def getBrowserVisible int_ptr = FFI::MemoryPointer.new :int check_error_code Lib.wdGetVisible(@driver_pointer, int_ptr), "unable to determine if browser is visible" int_ptr.get_int(0) == 1 ensure int_ptr.free end |
#getCurrentUrl ⇒ Object
35 36 37 38 39 40 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 35 def getCurrentUrl create_string do |wrapper| check_error_code Lib.wdGetCurrentUrl(@driver_pointer, wrapper), "unable to get current URL" end end |
#getCurrentWindowHandle ⇒ Object
139 140 141 142 143 144 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 139 def getCurrentWindowHandle create_string do |string_pointer| check_error_code Lib.wdGetCurrentWindowHandle(@driver_pointer, string_pointer), "unable to obtain current window handle" end end |
#getElementAttribute(element_pointer, name) ⇒ Object
345 346 347 348 349 350 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 345 def getElementAttribute(element_pointer, name) create_string do |string_pointer| check_error_code Lib.wdeGetAttribute(@driver_pointer, element_pointer, wstring_ptr(name), string_pointer), "unable to get attribute #{name.inspect}" end end |
#getElementLocation(element_pointer) ⇒ Object
464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 464 def getElementLocation(element_pointer) x = FFI::MemoryPointer.new :long y = FFI::MemoryPointer.new :long check_error_code Lib.wdeGetLocation(element_pointer, x, y), "unable to get location of element" Point.new x.get_int(0), y.get_int(0) ensure x.free y.free end |
#getElementSize(element_pointer) ⇒ Object
476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 476 def getElementSize(element_pointer) width = FFI::MemoryPointer.new :long height = FFI::MemoryPointer.new :long check_error_code Lib.wdeGetSize(element_pointer, width, height), "unable to get size of element" Dimension.new width.get_int(0), height.get_int(0) ensure width.free height.free end |
#getElementTagName(element_pointer) ⇒ Object
338 339 340 341 342 343 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 338 def getElementTagName(element_pointer) create_string do |string_pointer| check_error_code Lib.wdeGetTagName(element_pointer, string_pointer), "unable to get tag name" end end |
#getElementText(element_pointer) ⇒ Object
357 358 359 360 361 362 363 364 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 357 def getElementText(element_pointer) val = create_string do |string_pointer| check_error_code Lib.wdeGetText(element_pointer, string_pointer), "unable to get text" end val.gsub("\r\n", "\n") if val end |
#getElementValue(element_pointer) ⇒ Object
352 353 354 355 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 352 def getElementValue(element_pointer) val = getElementAttribute(element_pointer, 'value') val.gsub("\r\n", "\n") if val end |
#getElementValueOfCssProperty(element_pointer, prop) ⇒ Object
429 430 431 432 433 434 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 429 def getElementValueOfCssProperty(element_pointer, prop) create_string do |string_pointer| check_error_code Lib.wdeGetValueOfCssProperty(element_pointer, wstring_ptr(prop), string_pointer), "unable to get value of css property: #{prop.inspect}" end end |
#getPageSource ⇒ Object
59 60 61 62 63 64 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 59 def getPageSource create_string do |wrapper| check_error_code Lib.wdGetPageSource(@driver_pointer, wrapper), "unable to get page source" end end |
#getSpeed ⇒ Object
217 218 219 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 217 def getSpeed @speed end |
#getTitle ⇒ Object
52 53 54 55 56 57 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 52 def getTitle create_string do |wrapper| check_error_code Lib.wdGetTitle(@driver_pointer, wrapper), "unable to get title" end end |
#getWindowHandles ⇒ Object
130 131 132 133 134 135 136 137 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 130 def getWindowHandles raw_handles = FFI::MemoryPointer.new :pointer check_error_code Lib.wdGetAllWindowHandles(@driver_pointer, raw_handles), "unable to obtain all window handles" string_array_from(raw_handles).uniq # TODO: who calls raw_handles.free if exception is raised? end |
#goBack ⇒ Object
42 43 44 45 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 42 def goBack check_error_code Lib.wdGoBack(@driver_pointer), "Cannot navigate back" end |
#goForward ⇒ Object
47 48 49 50 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 47 def goForward check_error_code Lib.wdGoForward(@driver_pointer), "Cannot navigate back" end |
#hoverOverElement(element_pointer) ⇒ Object
436 437 438 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 436 def hoverOverElement(element_pointer) raise NotImplementedError end |
#isElementDisplayed(element_pointer) ⇒ Object
396 397 398 399 400 401 402 403 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 396 def isElementDisplayed(element_pointer) int_ptr = FFI::MemoryPointer.new :int check_error_code Lib.wdeIsDisplayed(element_pointer, int_ptr), "unable to check visibilty" int_ptr.get_int(0) == 1; ensure int_ptr.free end |
#isElementEnabled(element_pointer) ⇒ Object
376 377 378 379 380 381 382 383 384 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 376 def isElementEnabled(element_pointer) int_ptr = FFI::MemoryPointer.new(:int) check_error_code Lib.wdeIsEnabled(element_pointer, int_ptr), "unable to get enabled state" int_ptr.get_int(0) == 1 ensure int_ptr.free end |
#isElementSelected(element_pointer) ⇒ Object
386 387 388 389 390 391 392 393 394 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 386 def isElementSelected(element_pointer) int_ptr = FFI::MemoryPointer.new(:int) check_error_code Lib.wdeIsSelected(element_pointer, int_ptr), "unable to get selected state" int_ptr.get_int(0) == 1 ensure int_ptr.free end |
#quit ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 106 def quit getWindowHandles.each do |handle| begin switchToWindow handle close rescue Error::NoSuchWindowError end end # hack ObjectSpace.each_object(WebDriver::Element) { |e| finalize e.ref if e.bridge == self } ensure Lib.wdFreeDriver(@driver_pointer) @driver_pointer = nil end |
#refresh ⇒ Object
126 127 128 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 126 def refresh check_error_code Lib.wdRefresh(@driver_pointer), "unable to refresh current page" end |
#sendKeysToElement(element_pointer, string) ⇒ Object
366 367 368 369 370 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 366 def sendKeysToElement(element_pointer, string) check_error_code Lib.wdeSendKeys(element_pointer, wstring_ptr(string)), "unable to send keys to #{self}" waitForLoadToComplete end |
#setBrowserVisible(bool) ⇒ Object
75 76 77 78 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 75 def setBrowserVisible(bool) check_error_code Lib.wdSetVisible(@driver_pointer, bool ? 1 : 0), "unable to change the visibility of the browser" end |
#setElementSelected(element_pointer) ⇒ Object
425 426 427 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 425 def setElementSelected(element_pointer) check_error_code Lib.wdeSetSelected(element_pointer), "unable to select element" end |
#setImplicitWaitTimeout(milliseconds) ⇒ Object
80 81 82 83 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 80 def setImplicitWaitTimeout(milliseconds) check_error_code Lib.wdSetImplicitWaitTimeout(@driver_pointer, milliseconds), "unable to set implicit wait timeout" end |
#setSpeed(speed) ⇒ Object
213 214 215 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 213 def setSpeed(speed) @speed = speed end |
#submitElement(element_pointer) ⇒ Object
405 406 407 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 405 def submitElement(element_pointer) check_error_code Lib.wdeSubmit(element_pointer), "unable to submit element" end |
#switchToActiveElement ⇒ Object
95 96 97 98 99 100 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 95 def switchToActiveElement create_element do |ptr| check_error_code Lib.wdSwitchToActiveElement(@driver_pointer, ptr), "unable to switch to active element" end end |
#switchToDefaultContent ⇒ Object
102 103 104 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 102 def switchToDefaultContent switchToFrame "" end |
#switchToFrame(id) ⇒ Object
90 91 92 93 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 90 def switchToFrame(id) check_error_code Lib.wdSwitchToFrame(@driver_pointer, wstring_ptr(id)), "unable to locate frame #{id.inspect}" end |
#switchToWindow(id) ⇒ Object
85 86 87 88 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 85 def switchToWindow(id) check_error_code Lib.wdSwitchToWindow(@driver_pointer, wstring_ptr(id)), "unable to locate window #{id.inspect}" end |
#toggleElement(element_pointer) ⇒ Object
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 409 def toggleElement(element_pointer) int_ptr = FFI::MemoryPointer.new :int result = Lib.wdeToggle(element_pointer, int_ptr) if result == 9 raise WebDriver::UnsupportedOperationError, "You may not toggle this element: #{get_element_tag_name(element_pointer)}" end check_error_code result, "unable to toggle element" int_ptr.get_int(0) == 1 ensure int_ptr.free end |
#waitForLoadToComplete ⇒ Object
168 169 170 |
# File 'lib/selenium/webdriver/ie/bridge.rb', line 168 def waitForLoadToComplete Lib.wdWaitForLoadToComplete(@driver_pointer) end |