javaseleniumselenium-webdriverautomationselenium-iedriver

Selenium: Unexpected error launching IE. Browser zoom level was set to 122%. It should be set to 100%


I am trying to launch IE11 browser on my local machine using the following code.

try{System.setProperty("webdriver.ie.driver", "src/main/resources/bin/IEDriverServer.exe");
            }
            catch (Exception ex){
                Reporter.log("\nException in getting and setting the webdriver IE driver: "+ ex.getMessage() + ex.getClass(),true);
                ex.printStackTrace();
            }
            WebDriverManager.browser = browser;
            driver = new EventFiringWebDriver(new InternetExplorerDriver());
            driver.manage().deleteAllCookies();
            driver.manage().window().maximize();

When I run the code, it brings up the browser with http://localhost:22414/ and fails to load there after. Attaching the logs below.

org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.16 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'AAAAAA', ip: '123.123.123.123', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_79'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver

I manually tried setting the browser zoom level to 100%. Even then the error appears.


Solution

  • It may be fixing you the issue, however this could bring you troubles on the long run. Otherwise you may have issues with the native mouse events not identifying the coordinates correctly.

    Best way to fix this would be to actually go to the IE browser and set the zoom level the default value, 100%, by going to Settings -> Zoom.

    And if you're at it, also make sure that:

    . For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.

    You can find more details on the IE Driver github project page.