Unexpected error while launching Internet Explorer. Protected Mode settings are not the same for all zones.

You cannot open IE browser instance if Protected Mode settings are not the same for all zones OR if the browser is zoomed.
  1. To resolve this, Open IE Browser and go to Internet Options windows.
  2. Click on Security tab and make sure ‘Internet‘,’Local Intranet‘,’Trusted sites‘ and ‘Restricted sites‘ have ‘Enable Protected Mode‘ either checked or unchecked for all options.
  3. Apply and save the settings and re-run the test code. It should work.
Below workaround is provided which will help you to temporarily solve the problem.
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();

caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);

WebDriver driver = new InternetExplorerDriver(caps);
Note : If you don’t have permission to change IE settings,Request you to contact your IT administrator to get the required changes done.
  • Protected Mode is an important step forward in security for Internet Explorer (IE), it helps protect users from attack by running an IE process with greatly restricted privileges.
  • Protected Mode settings, like almost all other settings of IE, are stored in the Windows registry and are checked when the browser is instantiated.
  • The driver needed a workaround for people who couldn’t set those IE settings because their machine was overly locked down and so capabiltity fetaure was introduced.
  • It simply bypasses the registry check. Using the capability doesn’t solve the underlying problem though.
  • Unexpected hangs, element location not working, and clicks not being propagated, could result.
  • To help warn people of this potential problem, the capability was given big scary-sounding names like INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS.
  • Ask your IT support to make the changes and if still using the capability you are risking the stability of your code.

What is ‘Cross Browser Testing’ and why do we need it?

Cross Browser testing‘ is a type of functional test to check that your application works as expected in different browsers.
Below are some of the main reasons to perform Cross Browser Testing

  • Font size mismatch in different browsers.
  • JavaScript implementation can be different.
  • Some browser still not supporting HTML5.
  • Page alignment  and div size issue.
  • Image orientation.
  • Compatibility issues with OS. 

To execute the Test-cases with different browsers in the same machine at the same time we can integrate frameworks like Junit,TestNG with Selenium Web-driver.

How the name ‘Selenium’ came ?

An Automated Testing framework which was popular before Selenium was ‘QTP’.
QTP was developed by ‘Mercury Interactive’ and later acquired by ‘HP’.
Since Selenium is a well known Antidote for Mercury poisoning, this new Testing tool got his name to be ‘Selenium’

What is ‘Same Origin Policy’ in Selenium?

Lets Say, for a website ‘www.google.com’ the HTML code uses a JavaScript Program called ‘xyz.js’.
Because of same origin policy the ‘xyz.js’ file can access pages only from Google site. i.e Same domain and not from the other domain site like Yahoo,ebay,etc.
‘Same Origin Policy’ does not allow JavaScript code from accessing elements from other domain where it was Launched.
A JavaScript program can only access pages on the same domain where it belongs it cannot access pages from different domains.