Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

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 web-kit 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 web-kit driver (or pointing out where I could discover it myself) would be much appreciated.

1 Answer

0 votes
by (50.2k points)

As per the release, documentation version-2.3.0 has the following features

Version 2.3.0

Release date: 2014-06-02

Added

New window management API [Andrey Botalov]

Speed improvement for visible text detection in RackTest [Thomas Walpole] Thanks to Phillipe Creux for instigating this

RSpec 3 compatability

'save_and_open_screenshot' functionality [Greg Lazarev]

Server errors raised on a visit and synchronize [Jonas Nicklas]

As per this release note, version-2.3.0 and above has new window management API
So you can use this code 
new_window = window_opened_by { click_link 'Something' }
within_window new_window do
  # code
end
This will help you to resolve the problem.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...