Ignoring IE Driver Zoom Requirement

Many times I have kicked off an automated test using InternetExplorerDriver() only for it to crash straight away as the zoom was not set to 100%. (Why is this required, it makes no sense to me). Internet ExplorerPreviously the only way I could get around this was to open a new window of Internet Explorer, reset the zoom to 100%, close the browser, reopen the browser again to verify the correct zoom. While this worked it wasn’t a very elegant solution.

Finally I found how to ignore the zoom level requirement and it is as simple as this when starting up your browser:

var IE_Options = new InternetExplorerOptions
{
    IgnoreZoomLevel = true,
    EnableNativeEvents = false
};
driver = new InternetExplorerDriver(IE_Options);

This allows you to run your test without having to worry about what the zoom is currently set to.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s