With Capybara, how do I switch to the new window for links with “_blank” targets?
Perhaps this isn’t actually the issue I’m experiencing, but it seems that when I “click_link” a link with target=”_blank”, the session keeps the focus on the current window.
So I either want to be able to switch to the new window, or to ignore the _blank attribute – essentially, I just want it to actually go to the page indicated by the link so I can make sure it’s the right page.
I use the webkit and selenium drivers.
I submitted my findings thus far below. A more thorough answer is much appreciated.
Also, this only works with selenium – the equivalent for the webkit driver (or pointing out where I could discover it myself) would be much appreciated.
- You must login to post comments