On Fri, Jul 15, 2011 at 4:59 PM, Abe Heward <[email protected]> wrote:
> While using watir-webdriver and driving Firefox 5, if I click a link...
> browser.link(:how, "what").click
> ...and that link that has a target="_blank" in it, then instead of opening
> the page in a new tab (which is what happens if I click it manually), I get
> a new browser window, which is no longer attached to the browser instance,
> which breaks the script.
> Is there a way around this?
>

If you click something that opens a new window, you'll need to
explicitly switch to that window, e.g.:

  browser.window(:title => "foo").use

See the specs for more examples:

  https://github.com/jarib/watirspec/blob/watir2/window_switching_spec.rb#L19

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to