System.setProperty("webdriver.ie.driver","C:\\Users\\IEDriverServer_Win32_2.45.0\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("http://xxx");
Shows error while executing above code:
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.33 seconds
Can anyone suggest to resolve this issue?
解决方案
If u are behind proxy with no access provision to change the protected mode settings then use this capabilities
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
this will introduce some flakiness