Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i am trying to Automate one page like:-


WebDriver driver = new FirefoxDriver();
//Puts an Implicit wait, Will wait for 10 seconds before throwing exception
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
String title;
//Launch opposite
driver.navigate().to("http://naukri.com");

this is opening 3 other pop up i want to close all other pop up other that main window

What I have tried:

i tried to close the other pop up window like:-

driver.findElement(By.xpath("html/body/dl[1]/dd/a")).click();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.switchTo().window("PopUpWindow0");
driver.manage().window().maximize();
driver.close();

but i dont know how to close all the pop up at once
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900