Before moving ahead with the Internet Explorer automation, here we ‘re going to look some of the challenges and points you should follow before starting automation for the Internet Explorer browser.
Setting Protected Mode in IE
During the IE Automation, you may face some problems when browser open and it may show some errors for the Protected Zones in the browser as below.
Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
To resolve the below error, you can follow the below steps to update the Protected Mode settings in the IE browser.
- Open IE browser > Go to settings > Internet options > Security
- Click on Internet section and check Enable Protected Mode. Note that whichever you’ll choose here Enable/Disable same you need to choose for all other options.
- Repeat same process for the other options like Local Intranet, Trusted Sites and Restricted sites as well.
- Finally, click OK to accept the changes.
IE Browser Zoom Level Configuration
Another possible cause of your script failure is the browser zoom level isn’t set to 100% for the Internet Explorer, while running script you may face error as below.
Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)
Whenever you’ll face this issue, you need to recheck your IE browser zoom level by going IE Browser > Settings > Zoom and set to 100%.