class WebDriverScriptAdapter::FrameAdapter::ParentlessFrameAdapter

Selenium Webdriver < 2.43 doesnt support moving back to the parent

Public Instance Methods

within_frame(frame) { || ... } click to toggle source

storage of frame stack (for reverting to parent) taken from Capybara : github.com/jnicklas/capybara/blob/2.6.2/lib/capybara/selenium/driver.rb#L117-L147

There doesnt appear to be any way in Selenium Webdriver < 2.43 to move back to a parent frame other than going back to the root and then reiterating down

# File lib/webdriver_script_adapter/frame_adapter.rb, line 63
def within_frame(frame)
  @frame_stack[window_handle] ||= []
  @frame_stack[window_handle] << frame

  switch_to.frame(frame)
  yield
ensure
  @frame_stack[window_handle].pop
  switch_to.default_content
  @frame_stack[window_handle].each { |f| switch_to.frame(f) }
end