I wanna close the pop up window (known window name), and back to the original window. What shall I do? If I can't get a constant of the close button in window. so is there any general behavior to reach the goal?
Using WebDriver (shown with Java) you could do something like this:
// instantiate your driver
...
// get window handle
String baseWindowHdl = driver.getWindowHandle();
// navigate to pop-up
...
// close pop-up
driver.close();
// switch back to base window
driver.switchTo().window(baseWindowHdl);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With