How to switch control to new window if new window is opening only after closing the existing window?
I am using Selenium and Internet Explorer.
for (String h : webDriver.getWindowHandles()) {
webDriver.switchTo().window(h);}
WebElement element= webDriver.findElement(By.xpath("//*[@id='Standard']/p[1]"));
Actions a = new Actions(webDriver);
a.moveToElement(element).build().perform();