IE Driver Error: Browser zoom level was set to 104%. It should be set to 100%???

10,362 views
Skip to first unread message

sirus tula

unread,
Jan 18, 2013, 11:10:20 AM1/18/13
to seleniu...@googlegroups.com
I'm unable to run my tests via Internet Explorer driver. Whenever i try to run the script, it opens up the IE but I get the error message as attached below. It's happening both in selenium 2.27.0 and 2.28.0.
 
Current selenium version: 2.27.0.
Driver: IE Driver
System: Windows 7 64 BIT
 
C:\Users\sirus\AppData\Local\Temp\idea_testng2398069505981052034.tmp
Connected to the target VM, address: '127.0.0.1:54285', transport: 'socket'
Started InternetExplorerDriver server (64-bit)
2.29.0.0
Listening on port 30052
org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Browser zoom level was set to 104%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.59 seconds
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 15:53:30'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_10'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
 at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
 at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:151)
 at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:533)
 at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
 at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:201)
 at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:103)
 at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:49)
 at Util.DriverManager.get(DriverManager.java:94)
Disconnected from the target VM, address: '127.0.0.1:54285', transport: 'socket'
Process finished with exit code 0
 
Here's my snippet of driver script that drivers browsers just in case if you arei nterested.
 
public static WebDriver get() {
        if(useThisDriver==null){
            //String defaultBrowser= System.getProperty(BROWSER_PROPERTY_NAME, "FIREFOX");
           
            String defaultBrowser = "IE";
            long startBrowserTime = System.currentTimeMillis();
            switch (defaultBrowser) {
                case "FIREFOX":
                    FirefoxProfile profile = new FirefoxProfile();
                    profile.setEnableNativeEvents(true);
                    aDriver = new FirefoxDriver();//profile);
                    currentDriver = BrowserName.FIREFOX;
                    break;
                case "OPERA":
                    aDriver = new OperaDriver();
                    currentDriver = BrowserName.OPERA;
                    break;
                case "HTMLUNIT":
                    aDriver = new HtmlUnitDriver();
                    currentDriver = BrowserName.HTMLUNIT;
                    break;
                case "IE":
                    String currentUserDir = System.getProperty("user.dir");
                    String IEDriverLocation = currentUserDir + "/tools/iedriver_64/IEDriverServer.exe";
                    System.setProperty("webdriver.ie.driver", IEDriverLocation);

                    aDriver = new InternetExplorerDriver();
                    currentDriver = BrowserName.IE;
                    break;
                case "GOOGLECHROME":
                    //
http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
                    String currentDir = System.getProperty("user.dir");
                    String chromeDriverLocation = currentDir + "/tools/chromedriver/chromedriver.exe";
                    System.setProperty("webdriver.chrome.driver", chromeDriverLocation);
                    ChromeOptions options = new ChromeOptions();
                    options.addArguments("disable-plugins");
                    options.addArguments("disable-extensions");
                    aDriver = new ChromeDriver(options);
                    currentDriver = BrowserName.GOOGLECHROME;
                    break;
                case "SAUCELABS":
                    DesiredCapabilities capabilities = DesiredCapabilities.firefox();
                    capabilities.setCapability("version", "5");
                    capabilities.setCapability("platform", Platform.XP);
                    try {
                        // add url to environment variables to avoid releasing with source
                        String sauceURL = System.getenv("SAUCELABS_URL");
                        aDriver = new RemoteWebDriver(
                                new URL(sauceURL),
                                capabilities);
                    } catch (MalformedURLException e) {
                        e.printStackTrace();
                    }
                    currentDriver = BrowserName.SAUCELABS;
                    break;
            }

            long browserStartedTime = System.currentTimeMillis();
            browserStartTime = browserStartedTime - startBrowserTime;
            // we want to shutdown the shared brower when the tests finish
            Runtime.getRuntime().addShutdownHook(
                    new Thread(){
                        public void run(){
                            DriverManager.quit();
                        }
                    }
            );
        }else{
            try{
                // is browser still alive
                if(aDriver.getWindowHandle()!=null){
                    // assume it is still alive
                }
            }catch(Exception e){
                if(avoidRecursiveCall){
                    // something has gone wrong as we have been here already
                    throw new RuntimeException();
                }
                quit();
                aDriver=null;
                avoidRecursiveCall = true;
                return get();
            }
            savedTimecount += browserStartTime;
            System.out.println("Saved another " + browserStartTime + "ms : total saved " + savedTimecount + "ms");
        }
        avoidRecursiveCall = false;
        return aDriver;
    }

Any help would be appreciated.

 
 
- "If you haven't suffered, you haven't lived your life."
 
Thanks,
 
Sirus

jeevan

unread,
Jan 18, 2013, 11:16:25 AM1/18/13
to seleniu...@googlegroups.com
 Unexpected error launching Internet Explorer. Browser zoom level was set to 104%. It should be set to 100%
As per exception, make sure you set browser zoom level to 100% manually before you run test cases and run again.

Thanks,
Jeevan.

sirus tula

unread,
Jan 18, 2013, 11:20:02 AM1/18/13
to seleniu...@googlegroups.com
Good answer but how do you do that?

I tried ignoring zoom settings  but it didn't work.

 case "IE":
                    String currentUserDir = System.getProperty("user.dir");
                    String IEDriverLocation = currentUserDir + "/tools/iedriver_64/IEDriverServer.exe";
                    System.setProperty("webdriver.ie.driver", IEDriverLocation);
          DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
          caps.setCapability("ignoreZoomSetting", true);
                    aDriver = new InternetExplorerDriver();
                    currentDriver = BrowserName.IE;
                    break;
On Fri, Jan 18, 2013 at 10:16 AM, jeevan <g1re...@gmail.com> wrote:
 Unexpected error launching Internet Explorer. Browser zoom level was set to 104%. It should be set to 100%
As per exception, make sure you set browser zoom level to 100% manually before you run test cases and run again.

Thanks,
Jeevan.

On Fri, Jan 18, 2013 at 10:10 AM, sirus tula <selenium...@gmail.com> wrote:
Unexpected error launching Internet Explorer. Browser zoom level was set to 104%. It should be set to 100%


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Freddy Vega

unread,
Jan 18, 2013, 11:30:39 AM1/18/13
to seleniu...@googlegroups.com

Jim Evans

unread,
Jan 18, 2013, 11:44:43 AM1/18/13
to seleniu...@googlegroups.com
Everyone is right on the money. Set your zoom level to 100%. Easiest way to do that is manually open the browser and type "Control+0" (that is, hold the control key down and type the number zero).

I'm replying here because I want to address the statement "I tried ignoring zoom settings but that didn't work." You set the capability for ignoring the zoom settings, but then never used it with the IE driver. I'm not a Java expert, but I believe there's a constructor overload for InternetExplorerDriver that takes a Capabilities parameter. You'd need to pass that capabilities object into the constructor for the IE driver to know what to do with it.

--Jim

sirus tula

unread,
Jan 18, 2013, 11:47:33 AM1/18/13
to seleniu...@googlegroups.com
Great link Freddy.

I fixed the issue by doing "Ctrl and scrolling the window" to unzoom the IE. I never remember zooming the IE explorer window.
Nevertheless, it seems weird that the IE driver works only in 100% zoom window.

Thanks Jim, for the response.


To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/kZcb8y9M3igJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Aryasindhu Sahu

unread,
Oct 30, 2013, 4:02:19 AM10/30/13
to seleniu...@googlegroups.com
Hi you are creating the DesiredCapabilities for IE but not passing it to the constructor while creating the InternetExplorerDriver().

OLD CODE:
----------------
 System.setProperty("webdriver.ie.driver", IEDriverLocation);
          DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
          caps.setCapability("ignoreZoomSetting", true);
                    aDriver = new InternetExplorerDriver();

NEW CODE
--------------------
 System.setProperty("webdriver.ie.driver", IEDriverLocation);
          DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
          caps.setCapability("ignoreZoomSetting", true);
                    aDriver = new InternetExplorerDriver(caps);

Rahul Jadhav

unread,
Nov 10, 2016, 3:34:20 PM11/10/16
to Selenium Users
Hi could plz tell me how can i set chrome zoom level at 75% or 80 % and run the script so that it driver can ignore the zoom setting.
Reply all
Reply to author
Forward
0 new messages