tags:

views:

150

answers:

1

Some links on our page open in a new window using target="_blank". How can I make selenium look at the right window so I can verify that the page is linking to the right page?

Here's what I've been trying:

open                /page/
click               link=Find us on Facebook!
pause               2000
selectWindow        title=window title
verifyTextPresent   some text
+1  A: 

You don't need to pass a parameter to selectWindow. The browser will automatically give your new window focus, you just need to tell selenium that it's changed. Also make sure you give your new window enough time to actually load before verifying anything:

open                /page
click               link=Find us on Facebook!
pause               1000
selectWindow
verifyTextPresent   some text
Helephant