In my application when I click on a Link a Alert window opens having some
input text fields. Like name etc...
This pop up is opened as new window ,,,user could not close the browser
even if this window is present....
I have tried
String ParentWindowHandle = driver.getWindowHandle(); /*
*
(This is for
*
Parent Window Id)
*/
System.out.println(driver.getTitle()); /* (Parent window
title) */
driver.findElement(By.xpath("//div[6]//table[2]//td[2]/span/a")).click();/*
* (it will
open modal
* dialog
popup window)
*/
Set<String> availableWindows = driver.getWindowHandles();/*
*
(get all the
*
window
*
handles after
*
the modal
*
popup window
*
appears)
*/
System.out.println(availableWindows.size());
int Windows = 2;
if (availableWindows.size() == Windows) {
String popUpWindowHandle = null;
for (String popupwindow : availableWindows) {
//if (!availableWindows.equals(ParentWindowHandle))
popUpWindowHandle = popupwindow;
driver.switchTo().window(popUpWindowHandle);/*
*
(Switch to modal
*
dialog popup
*
window)
*/
System.out.println("pop up window title is "
+driver.getTitle()); /* (Verify modal dialog title) */
but my script does not run after
driver.findElement(By.xpath("//div[6]//table[2]//td[2]/span/a")).click();/*
* (it will
open modal
* dialog
popup window)
*/
it clicks on the link that opens a new alert pop up window ....and does not
run after this
driver.switchTo().window(popUpWindowHandle) does not switch to new
window.....
Please help....!!!
Thanks in Advance
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/fV1yugDKe3YJ.
For more options, visit https://groups.google.com/groups/opt_out.