[Java] How to deal with the IE zoom level not 100% problem?

53 views
Skip to first unread message

baiyan...@gmail.com

unread,
Mar 2, 2019, 11:24:09 PM3/2/19
to Selenium Users

Hi,

I have two Selenium Server nodes running as Jenkins slave on remote with IE 11 and win 10. The browser's zoom level and windows display setting have set to 100%.

If someone connect the remote sever using remote desktop(mstsc.exe) with win 10 and the display settings is not 100% while then the selenium test start, the IE zoom level exception will be thrown and the test will be interrupted.

I have try to use ignoreZoomSetting as follow:

        DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
        capability.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);
        return new RemoteWebDriver(new URL(url), capability);   

but it doen't work.

Now I'm trying to find a way to reset the IE zoom level to 100% before the Selenium Sever launch the browser instance. Does anybody have ideas?

Thanks

Message has been deleted

baiyan...@gmail.com

unread,
Mar 4, 2019, 7:52:57 AM3/4/19
to Selenium Users
The error message is:

Unexpected error launching Internet Explorer. Browser zoom level was set to 109%. It should be set to 100%

Could anyone give me some advice?

I can use ignoreZoomSetting option with InternetExplorerDriver for local Browser lauching, but I have no ideas with RemoteWebDriver.

I need to do one of the two things:

Let the RemoteWebDriver ignore the ignoreZoomSetting or reset the IE zoom level to 100% before the Selenium Sever launch the browser instance.

If anyone has any ideas, give me some guides please. 

Serguei Kouzmine

unread,
Mar 6, 2019, 11:51:33 PM3/6/19
to Selenium Users
@baiyan


Have you tried
```
import org.openqa.selenium.Keys;
import org.openqa.selenium.interactions.HasInputDevices;
import org.openqa.selenium.interactions.Keyboard;

Keyboard keyboard = ((HasInputDevices) driver).getKeyboard();
keyboard.sendKeys(Keys.chord(Keys.CONTROL, "0"));
```

i do not have ie profile in my test class handy atm, so i can not really test it. noted that it works  for some browsers but not all, notably seem to be ignored by chrome

baiyan...@gmail.com

unread,
Mar 7, 2019, 8:42:56 AM3/7/19
to Selenium Users
@Serguei

So appreciate for your reply.

Yes, I have tried to send combo keys to reset zoom level.

But it doesn't work, because the RemoteWebDriver will verify the zoom level of IE first, when it is not 100%, an Exception will be thrown, then we can't do anything else.
Reply all
Reply to author
Forward
0 new messages