How to handle page loading advertisement popup selenium

749 views
Skip to first unread message

mari muthu

unread,
May 31, 2012, 7:24:33 AM5/31/12
to seleniu...@googlegroups.com
Hi All,

I want to handle / close all advertisement popup. For example,

when we hit http://www.naukri.com , we will get 2 or 3 ad popup. I want to handle those popups using selenium rc.

Since all ads are dynamic and differ in every request, I cant give static title or name.

String nWin[];
selenium.open("http://www.naukri.com/");

selenium.waitForPageToLoad("90000");
nWin=selenium.getAllWindowTitles();
System.out.println(nWin.length);
for (int i = 0; i < nWin.length; i++) {
System.out.println(nWin[i]);
}

When I use above , it is recognise only parent window and ad popup is not recognised.

Can you please help me...

Thanks & Regards,
M.Marimuthu


Shaba K

unread,
May 31, 2012, 8:55:40 AM5/31/12
to seleniu...@googlegroups.com
I think you can get all windowHandles  in a list or an array & close them one by one isn't it.



Cheers,
S



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/EIfT9vBIMmoJ.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Reply all
Reply to author
Forward
0 new messages