1

Some of the teams are using IE for which we added ie capabilities including the one specified below: cap.setCapability("ignoreZoomSetting", true);

Now if my zoom is set to 100%, I don't face any issues with execution. But in case my zoom setting is set to anything other than 100%, this capability helps opening up the browser but my test case fails because it's unable to find the required objects on the page. Is there any way, we can change the zoom level to 100% while opening up the browser or any other thoughts on how to handle this situation?

DebanjanB
  • 118,661
  • 30
  • 168
  • 217
VJ4Testing
  • 69
  • 5

2 Answers2

0

As per the Required Configuration for InternetExplorerDriver:

The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.

Additionally,

For Windows 10, you also need to set "Change the size of text, apps, and other items" to 100% in display settings.

So while using InternetExplorerDriver and InternetExplorer you need to configure the following:

cap.setCapability("ignoreZoomSetting", true);
cap.setCapability("requireWindowFocus", false);
cap.setCapability("nativeEvents", false);

You can find a couple of relevant discussions in:

So setting these capabilities are part of best practices and incase with these configurations the browser initialization is having issue that needs detailed analysis.


However, at this point it's worth to mention that:

On IE 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode".

You can find a couple of relevant discussions in:


tl;dr

A couple of related discussions:

DebanjanB
  • 118,661
  • 30
  • 168
  • 217
  • @VJ4Testing [Upvote](https://stackoverflow.com/help/why-vote) the answer if this answer was helpful to you for the benefit of the future readers. – DebanjanB Dec 24 '19 at 08:18
0

From the Required Configuration, you must set the browser zoom level to 100% so that the native mouse events can be set to the correct coordinates. DebanjanB's answer has explained this clearly. Besides his approcah, you could open IE browser with zoom level 100% by setting the Internet Options:

Internet Options> Advanced> Check "Reset zoom level for new windows and tabs"> Click Apply> Click OK

enter image description here

Then when new windows or tabs are opened, they should be at zoom 100% every time.

Yu Zhou
  • 6,874
  • 1
  • 4
  • 20