How to close the pop up window in selenium running?
问题 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? 回答1: Have you tried: selenium.Close(); selenium.SelectWindow("null"); 回答2: 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