0

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();
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • How is _new window is opening_ ? Code trial please. – undetected Selenium Feb 02 '18 at 13:47
  • Welcome to Stack Overflow! Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [ask] page for help clarifying this question. – JeffC Feb 02 '18 at 14:50
  • This can be understood as suppose if I click on a link of the webpage then the the link is opening on a new window and the existing (the window from which the link was clicked) is closing before opening the new window. – A.Mishra Feb 05 '18 at 05:14

0 Answers0