Object
get the active element
@return [WebDriver::Element]
# File common/src/rb/lib/selenium/webdriver/target_locator.rb, line 56 def active_element @bridge.switchToActiveElement end
selects either the first frame on the page, or the main document when a page contains iframes.
# File common/src/rb/lib/selenium/webdriver/target_locator.rb, line 64 def default_content @bridge.switchToDefaultContent end
switch to the frame with the given id
# File common/src/rb/lib/selenium/webdriver/target_locator.rb, line 17 def frame(id) @bridge.switchToFrame id end
switch to the frame with the given id
If given a block, this method will return to the original window after block execution.
@param id
A window handle
# File common/src/rb/lib/selenium/webdriver/target_locator.rb, line 31 def window(id) if block_given? original = @bridge.getCurrentWindowHandle @bridge.switchToWindow id yield current_handles = @bridge.getWindowHandles if current_handles.size == 1 original = current_handles.shift end @bridge.switchToWindow original else @bridge.switchToWindow id end end
Generated with the Darkfish Rdoc Generator 2.