1

I am getting the zoom level error for IE which I understand is a known issue. I've been able to find a resolution for this in both Java and C# but I can't seem to find the workaround in Python. Here is what has been reported to work in Java and C#:

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

Anyone have any experience doing the same thing in Python? I'd also be fine with a set zoom level to 100% but I have not been successful with any iteration of that phrase in python.

4
  • Why not just load IE manually and set the zoom level yourself, once? Why are you trying to do this in code when it can be done within seconds using your own mouse? Commented Dec 16, 2013 at 15:57
  • 1
    I'd like to do this programatically for multiple users so that I don't have to fix this every time a new user has an issue with it. Commented Dec 16, 2013 at 16:09
  • 1
    This is entirely the wrong capability to set if you're getting an error about zoom level. What you really want to ignore the zoom level is to pass the "ignoreZoomLevel" capability. If you're ignoring Protected Mode settings, You're Doing It Wrong. Commented Dec 16, 2013 at 16:15
  • You're right @JimEvans. I had copied the wrong code into the lines above. Apologies. I have edited above to reflect the correct snippet. Commented Dec 16, 2013 at 16:45

2 Answers 2

2

You can edit the registry to ensure that the zoom level for IE is set to 100% before launching your test.

The registry setting is at HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Zoom

For 100% zoom, you'll want the value for the ZoomFactor to be 100000 or 186a0 (if you need the hexidecimal value).

Since you're using Python, it looks like you could use the winreg module to edit the Windows registry.

Sign up to request clarification or add additional context in comments.

Comments

0

If you are like me, every time you searched for a python specific way to ignore Zoom you found your way here. For anyone else out there who keeps running into this post on Google- you need to pass "ignoreZoomSetting" in as a dictionary when creating a web driver instance. By default, ignoreZoomSetting is set to False:

    page = webdriver.Ie(executable_path="C:\\IEDriverServer.exe", capabilities={'ignoreZoomSetting':True})
    page.get('https://www.google.com/')

Keep in mind the zoom setting is required for native mouse events, as referenced here. You will probably run into some odd situations as I did.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.