Selenium Automation Challenges in IE browser |Selenium Automation
Below are the challenges we face during automation testing on IE
browser using selenium.
- Protected Mode settings are not the same for all zones
- Unexpected error Browser zoom level
- SendKeys method types character very slow when running script in IE browser
- Untrusted SSL certificate error in IE browser
How to set the Protected Mode settings in IE Browser:
When we are executing the script on IE browser, if protected mode
settings is not done, we will get below exception:
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)
If you see the above error, it clearly says that there is some issue
with the Protected Mode Settings and the Protected Mode Settings are not same
for all the zones. To avoid this error we need to set the Protected Mode Settings same for all the Zones.
1) Go to Tools > Internet Options and Under Internet Options click on
the Security tab.
2) Click on the Internet zone to Select a zone and to view its Protected Mode property.
3) Now check the Enable Protected Mode check-box. Whichever one you choose, needs to be set for
all the other zones. Means either it can be OFF for all the zones or ON for all the zones.
4) Repeat this task for all the below zones:
- Internet
- Local Intranet
- Trusted Sites
- Restricted Sites
5) Click OK and run the Selenium script again. It will work this
time.
Unexpected error Browser zoom level:
If your application is not starting or you are just getting one or
multiple InternetExplorerDriver Listening on port
window messages or if the below exception is appeared in the Eclipse
Console, than your IE browser’s zoom level might be set to something
other than 100%.
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)
To fix make sure that the Internet Explorer’s Zoom property is set to 100%
SendKeys method types character very slow when running script in
IE browser:
This is again a very common issue with IE Browser that the Sendkey
method works very slow with Selenium script. But again, not a rocket
science to resolve this issue. Simply replace the current IEDriverServer.exe (if your machine is 64 bit machine) with IEDriverServer.exe of 32 bit
1. Download IEDriverServer.exe of 32 bit system even if
the system is 64 bit machine.
2. Extract the Zip file and place the IEDriverServer in the same folder where the earlier version
of IEDriverServer is available. It will replace the
old file with new.
3. Run the script again and this time the sendsKey() would work and the way it works in Chrome and
Firefox.
Untrusted SSL Certificate:
Internet Explorer is the product of Microsoft and IE is much worried about security and IE
is known as the most secured browser. At times using IE Browser with
Selenium gives SLL Certificate pop up. In order to avoid this you set the below desired
capability:
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Public void ieBrowserSetup {
System.setProperty("webdriver.ie.driver", "D:\\drivers\\IEDriverServer.exe");
// Create the DesiredCapability object of InternetExplorer
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
//Settings to Accept the SSL Certificate in the Capability object
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
InternetExplorerDriver driver = new InternetExplorerDriver(capabilities);
driver.get("URL for which certificate error is coming");
}
No comments:
Post a Comment
If any suggestions or issue, please provide