s***@gmail.com
2018-09-04 05:57:54 UTC
0down votefavorite
<https://stackoverflow.com/questions/52159579/target-window-already-closed-from-unknown-error-web-view-not-found#>
String mainWindow = driver.getWindowHandle();
driver.findElement(By.xpath(pro.getProperty(""))).click();
for(String newWindow : driver.getWindowHandles()){
driver.switchTo().window(newWindow);
}
driver.close();
Log.info("Closing the current Opened Window - Invoice");
driver.switchTo().window(mainWindow); ---error in this line
I am getting error while switching to main window. error is like:
org.openqa.selenium.NoSuchWindowException: no such window: target window
already closed from unknown error: web view not found
i have tried switching to default window, commenting driver.close and
adding thread.sleep also but issue not resolved.
<https://stackoverflow.com/questions/52159579/target-window-already-closed-from-unknown-error-web-view-not-found#>
String mainWindow = driver.getWindowHandle();
driver.findElement(By.xpath(pro.getProperty(""))).click();
for(String newWindow : driver.getWindowHandles()){
driver.switchTo().window(newWindow);
}
driver.close();
Log.info("Closing the current Opened Window - Invoice");
driver.switchTo().window(mainWindow); ---error in this line
I am getting error while switching to main window. error is like:
org.openqa.selenium.NoSuchWindowException: no such window: target window
already closed from unknown error: web view not found
i have tried switching to default window, commenting driver.close and
adding thread.sleep also but issue not resolved.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/22e834e4-d221-4d00-994a-081446055117%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/22e834e4-d221-4d00-994a-081446055117%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.