Open link in a new window with Capybara

In Capybara, is it possible to open a link in a new window, and not in the current one?

+7
source share
1 answer

If this element is a link, you can simply get it href and open it in a new window:

url = find('.some_link')[:href] within_window open_new_window do # do something end 

open_new_window was added in Capybara 2.3

+4
source

All Articles