How to switch from main window to popup window?
问题 I'm not talking about the popups like alert, confirm or prompt dialogs. In the application if I click on a button popup gets opened. I am not able to switch the WebDriver to the popup window. I've tried to use getWindowHandles() but it only returns the main window handle. I also tried switchTo.window("windowname") but it didn't work. 回答1: Usually Modular Windows are part of the same DOM, unlike javascripts alerts. Only thing that sets them apart from rest of the page is that they are in