Capybara access new window
I just leave this here:
When (/^I access the new window$/) do
if Capybara.javascript_driver == :webkit
page.driver.browser.window_focus( page.driver.browser.window_handles.last)
else
page.driver.browser.switch_to.window( page.driver.browser.window_handles.last)
end
end
Written by Kirill Shaplyko
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#