Reputation: 433
In Capybara, is it possible to open a link in a new window, rather than the current one?
Upvotes: 10
Views: 2849
Reputation: 21096
If this element is a link you can just get its 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
has been added in Capybara 2.3
Upvotes: 7