Selenium selectWindow command

View: New views
3 Messages — Rating Filter:   Alert me  

Selenium selectWindow command

by rawat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

In one of the test, i m clicking a button which causes a new window to open. When i recorded from selenium ide it gave below sequence.

selenium.click("Finish_Button");
selenum.selectWindow("browserwin");

But when am running this then selenium RC giving an error

"window is closed or not open"

After clicking button i tried giving sleep but that also didn't worked.

Please help me

Thanks
Rawat



Re: Selenium selectWindow command

by ajayjoc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Better try using wait condition.
rawat wrote:
Hi guys,

In one of the test, i m clicking a button which causes a new window to open. When i recorded from selenium ide it gave below sequence.

selenium.click("Finish_Button");
selenum.selectWindow("browserwin");

But when am running this then selenium RC giving an error

"window is closed or not open"

After clicking button i tried giving sleep but that also didn't worked.

Please help me

Thanks
Rawat


Re: Selenium selectWindow command

by kjaladi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or try to move the focus to new window and then run the script. use this command - windowFocus

thanks.