RE: [webdriver] "Unexpected error launching Internet Explorer. Browser zoom level was set to 0%." Except it isn't.

6,496 views
Skip to first unread message

Mark Collin

unread,
Jul 30, 2012, 2:58:39 PM7/30/12
to webd...@googlegroups.com

I’m guessing your problem is:

 

Browser zoom level was set to 0%. It should be set to 100%

 

From: webd...@googlegroups.com [mailto:webd...@googlegroups.com] On Behalf Of Olav Kokovkin
Sent: 30 July 2012 14:07
To: webd...@googlegroups.com
Subject: [webdriver] "Unexpected error launching Internet Explorer. Browser zoom level was set to 0%." Except it isn't.

 

Hello,

I've been using Selenium 2 for over a week now. At first i played around with this example from SeleniumHQ. I tried FirefoxDriver and InternetExplorerDriver and both worked fine. Now, i don't know what has changed, but when trying to run InternetExplorerDriver, i get this error:

 

Started InternetExplorerDriver server (64-bit)
2.25.2.0
Listening on port 14060
Exception in thread "main" org.openqa.selenium.WebDriverException: Unexpected error launching Internet Explorer. Browser zoom level was set to 0%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.70 seconds
Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 15:28:49'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_05'
Driver info: driver.version: InternetExplorerDriver
Session ID: 54d9b5eb-9b76-4e2d-b013-7ea05bcb13cc
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188)
   at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
   at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:472)
   at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:155)
   at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:114)
   at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:54)
   at org.openqa.selenium.example.Selenium2Example.testTest(Selenium2Example.java:40)
   at org.openqa.selenium.example.Selenium2Example.main(Selenium2Example.java:14)

 

Naturally, i have checked and double-checked that i really do have zoom level set to 100%. I don't think you even can set it to 0%, so it seems that Selenium tries to check the zoom level but fails.

Has anyone else come across this?

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/LpYUIErpofcJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

Mark Collin

unread,
Jul 30, 2012, 3:01:10 PM7/30/12
to webd...@googlegroups.com

OK I suffered a bit from tl;dr and fired early J

 

I’ve not seen this (but I haven’t tried 2.25.2 IEDriver server)

 

Does it work fine with the previous version?  If so you may have found a bug.

Olav Kokovkin

unread,
Jul 31, 2012, 3:06:35 AM7/31/12
to webd...@googlegroups.com
No worries :)
I haven't checked earlier version yet, because i did get it working on  2.25.2 when i first tried it. But i'll try the older one, see how that works. Thanks.
- Olav

To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.


For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.

To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

Jim Evans

unread,
Jul 31, 2012, 5:32:48 AM7/31/12
to webd...@googlegroups.com
I replied to this earlier, but my reply seems to have gotten eaten. Zoom detection is new in 2.25.2 of IEDriverServer.exe. To help us diagnose the problem, you can increase the logging level on the server (see other posts for examples of how to do this for IEDriverServer.exe). If you don't care about helping us fix it, you can pass the "ignoreZoomLevel" capability to the driver constructor (again, see other posts cot examples how to do this in your language binding).

Olav Kokovkin

unread,
Jul 31, 2012, 7:21:50 AM7/31/12
to webd...@googlegroups.com
Hi,
Sorry, but i'll need a bit more help than that. Tried searching how to set logging level, but Eclipse doesn't show InternetExplorerDriverService.Builder to have any methods, so i don't know how to use the builder. Also, tried to set ignoreZoomLevel but the only InternetExplorerDriver constant i can find for setCapability(string, bool) is INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS. Could you elaborate?
Thanks!

Jim Evans

unread,
Jul 31, 2012, 7:42:51 AM7/31/12
to webd...@googlegroups.com
For setting the log file info, you can do something like:

InternetExplorerDriverService service = InternetExplorerDriverService.Builder()
.usingAnyFreePort()
.withLogFile(newFile("target/iedriver1.log"))
.withLogLevel(InternetExplorerDriverLogLevel.TRACE)
.build();

DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
WebDriver driver = new InternetExplorerDriver(service, caps);

To set the capability, the Java bindings may not have a constant defined, but you can use the string literal, like so:

caps.setCapability("ignoreZoomLevel", true);

Olav Kokovkin

unread,
Jul 31, 2012, 8:09:57 AM7/31/12
to webd...@googlegroups.com
Nope, still:
1. The method Builder() is undefined for the type InternetExplorerDriverService
2. The constructor InternetExplorerDriver(InternetExplorerDriverService, DesiredCapabilities) is undefined
3. After only setting  ignoreZoomLevel to true and using the InternetExplorerDriver(DesiredCapabilities) constructor, i STILL get the "Browser zoom level was set to 0%. It should be set to 100%" error message

Olav Kokovkin

unread,
Jul 31, 2012, 8:16:53 AM7/31/12
to webd...@googlegroups.com
To clarify, this is how i'm constructing my driver now:
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability("ignoreZoomLevel", true);
driver = new InternetExplorerDriver(caps);
And i still get the 0% zoom error.

Jim Evans

unread,
Jul 31, 2012, 8:49:37 AM7/31/12
to webd...@googlegroups.com
Sorry, the capability is actually "ignoreZoomSetting". I was on a mobile device when I wrote that, and was doing it from memory.

I'm not normally a user of the binary distributions of the language bindings, preferring to build from source. I'm quite sure those methods are available on the object returned by the Builder() method and that the constructor I've referenced are available in the current sources. I have no idea if their available in the latest packaged release; they will be available for certain in the next packaged release.

--Jim

Olav Kokovkin

unread,
Jul 31, 2012, 8:52:20 AM7/31/12
to webd...@googlegroups.com
Yeah, thanks, that did it! Can't help you with the logs though. Sorry :(
- Olav

Olav Kokovkin

unread,
Oct 31, 2012, 9:17:04 AM10/31/12
to webd...@googlegroups.com
Hi,
Yeah, sorry, that's the same way I did it. I'm kinda busy now, and that was a few months ago, so i can't help you much more, but looking at my source, this is how i did it:
 
WebDriver driver; 
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability("ignoreZoomSetting", true);
driver = new InternetExplorerDriver(caps);

Ok i also ran that script, and it works for me. The only difference i can see, is that your .InternetExplorer() starts with a capital letter, mine is .internetExplorer()

Hope that helps :)

On Wednesday, October 31, 2012 1:25:05 AM UTC+2, wonuto wrote:
Olav - were you able to fix this issue? I am getting following error:
 
Cannot convert from 'OpenQA.Selenium.Remote.DesiredCapabilities' to 'OpenQA.Selenium.IE.InternetExplorerOptions' 
 
And this is how I constructing driver:
 
DesiredCapabilities caps = DesiredCapabilities.InternetExplorer();
caps.setCapability("ignoreZoomSetting", true);
driver = new InternetExplorerDriver(caps);
~

Jim Evans

unread,
Oct 31, 2012, 10:39:36 AM10/31/12
to webd...@googlegroups.com
You're using the .NET bindings. That means you need to use the InternetExplorerOptions class, like this:

InternetExplorerOptions options = new InternetExplorerOptions();
options.IgnoreZoomLevel = true;
IWebDriver driver = new InternetExplorerDriver(options);


On Tuesday, October 30, 2012 7:25:05 PM UTC-4, wonuto wrote:
Olav - were you able to fix this issue? I am getting following error:
 
Cannot convert from 'OpenQA.Selenium.Remote.DesiredCapabilities' to 'OpenQA.Selenium.IE.InternetExplorerOptions' 
 
And this is how I constructing driver:
 
DesiredCapabilities caps = DesiredCapabilities.InternetExplorer();
caps.setCapability("ignoreZoomSetting", true);
driver = new InternetExplorerDriver(caps);
~

 

On Tuesday, July 31, 2012 7:52:20 AM UTC-5, Olav Kokovkin wrote:

Duncan Lawrence

unread,
Nov 13, 2013, 12:27:44 PM11/13/13
to webd...@googlegroups.com
This how I did this

InternetExplorerOptions ieo = new InternetExplorerOptions 
                        { IgnoreZoomLevel = true };
var driver = new InternetExplorerDriver(ieo));

works great!
Reply all
Reply to author
Forward
0 new messages