Exception (org.openqa.selenium.NoSuchWindowException): using Selenium WebDriver with Java in Internet Explorer Exception (org.openqa.selenium.NoSuchWindowException): using Selenium WebDriver with Java in Internet Explorer selenium selenium

Exception (org.openqa.selenium.NoSuchWindowException): using Selenium WebDriver with Java in Internet Explorer


case "ie_driver":               //IE CODE    DesiredCapabilities cap = new DesiredCapabilities();    cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);    cap.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "https://testvmm6.partnersonline.com/vmm");    cap.internetExplorer().setCapability("ignoreProtectedModeSettings", true);    System.setProperty("webdriver.ie.driver", System.getProperty("user.dir")+"//exe//IEDriverServer1.exe");    cap.setCapability("IE.binary", "C:/Program Files (x86)/Internet Explorer/iexplore.exe");    cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);    cap.setJavascriptEnabled(true);    cap.setCapability("requireWindowFocus", true);    cap.setCapability("enablePersistentHover", false);


The issue that helped me was to set init page (IE 11 both 32 and 64)

 private WebDriver getIEDriver() {    DesiredCapabilities cap = new DesiredCapabilities();    cap.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, INIT_PAGE);    File file = new File("E:/drivers/IEDriverServer.exe");    System.setProperty("webdriver.ie.driver", file.getAbsolutePath());    return new InternetExplorerDriver(cap); }