
In this post, I will show you couple of Challenges with IE browser in Selenium Webdriver. This post is going to use full for them who are working on Selenium with IE browsers and for them who are attending interviews because today we are going to discuss Issues with the IE browser.
If you are new to Selenium and never worked on IE browser then checkout below video for IE browser in Selenium
How To Start Session In IE Browser
Challenges with IE browser in Selenium Webdriver
You will get the different types of Exception while working with IE Browser I will try to sum up some exceptions, which I faced, and what are the solutions that worked for me.
If you are new to Selenium then check below URL to get familiar with exceptions.
How to handle exception in Selenium
What are the exception available in Selenium
Exceptions and their Solutions
Issues 1-
-
openqa.selenium.NoSuchWindowException
This is a common issue with Selenium and you can avoid this by doing some IE setting, which we are going to discuss now.
Issue 2-
-
sendKeys works very slow it takes 1-2 second to type each character.
This is a known issue with Selenium and it only happens once you work with IE 64 bit driver.
Solution- You can download IE Driver 32 bit and start using it, even you are working with 64 bit OS this 32 bit IE driver works every time.
Issue 3-
-
Unexpected error launching Internet Explorer. Protected Mode must be set to the same value
When I started working with IE this was the first exception, which I used to get, and I was sure that this related to some browser setting.
You can make the below changes in IE and this exception will not come again.
Please make the following changes as per screenshot.
Click ALT button from keyboard.
Click on the security tab and click on the Internet icon and enable protected mode.
Same settings we have to do for other zones as well so select Local intranet.
Click on Trusted sites and click on enable checkbox and navigate to Restricted sites.
Finally click on OK and apply and you are done.
Issue 4-
Unexpected error launching Internet Explorer. Browser zoom level was set to 0%
By the name itself, you can see that we have to set the zoom level to 100 % to make it work.
You can follow below instruction to set browser zoom level.
Issue 5:
Handle Untrusted SSL certificate error in IE browser in different ways
Solution: IE is the product of Microsoft and IE is much worried about security so when you start working with some https application you will get a untrusted certificate.
Selenium has so many ways to handle this, but we will see 2 ways which work all the time for me.
First:
1- Open the application for which SSL certificate is coming so use below code after passing the URL.
driver.get(“ur app URL”);
driver.navigate().to(“javascript:document.getElementById(‘overridelink’).click()”);
// you can use your code now
Second:
You can handle this certificate using Desired Capabilities as well.
I have already covered this topic long back so follow the below link to handle certificates in IE, Chrome, Firefox etc.
How to handle certificate in Selenium Webdriver
This is what I faced and the solution that I know. In case you have some other thing that you want to add then please comment below or contact me to add some more relevant stuff on IE.
For More updates Learn Automation page
For any query join Selenium group- Selenium Group
Comment below for any clarification
Hi Mukesh , using selenium on edge browser in IE mode , unable to take full page screenshot. Only half screenshot is getting captured. Could you please suggest a way out of it ? I have used ashot but no luck
Hi Luffy, you can try AShot lib for screenshot of full page.
How to run ie selenium automation in the background? Or any other way for which I don’t have to wait for automation to get over and work on different program simultaneously
Hi Megha,
You can opt for the Headless mode of execution. Hopefully, this will work for you…:)
Hi Mukesh
I have a issues with IE, while running the scripts in batch on IE, if i lock the system or focus is not on IE, then all my scripts starts failing, But they pass, if focus is on IE.
Is there any settings for this?
Thanks in Advance.
Regards,
Giri
Hi Giri,
It would be better if you can avail of a virtual machine where you run your scripts hassle-free. Make that machine never lock using admin settings.
Hi Mukesh,
I am using IE browser. The issue I am facing is: when I clicks button from main window, it opens a child window. This child window gets opened in new window (and not in new tab which is fine). But the child window is not able to maintain the same session as that of parent window. It asks for credentials again. Can you please help?
Hi Ankur,
Kindly check this link http://learn-automation.com/handle-multiple-windows-in-selenium-webdriver/
Hi Mukesh
Please help me for this issue.
If I am opening any link inside webpage. Then it is opening in new window instead of new tab.
. But manually it is working fine.
Hi Anand,
In this case, you can use WindowHandles to manage multiple windows as in automation IE behaves bit different.
You can try with Internet Options -> General -> Settings/Tabs -> Always open pop-ups in new tab and observe your Selenium behavior
Hi Mukesh, I have done with all the browser settings and the IE driver update my script ended with “Only local connections are allowed” but after that no browser launch and anything please help
Below are the versions im using
IE: 11
IE Driver: IEDriverServer_Win32_3.141.59
Selenium IE Driver: 3.4.0 jar
Selenium: 3.0
Hi Vamsi,
What exception/error message are you getting on console?
Hello Sir, Thanks much!
Contents posted by you are very easy to follow and relate with day to day project work.
Can we handle “Unexpected error launching Internet Explorer. Browser zoom level was set to 0%” error through code?
Hi Preetam,
Through selenium it is not possible…We have to set browser zoom level at 100% prior to test execution.
Hi,
How to Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.
Hi Sandeep,
Open IE -> Click on ‘Gear’ icon on right top -> Click ‘Internet Options’ -> Go to Security tab
Usually make it enabled for all zones. If you ar enot able to edit above mentioned settings then it is managed by your System Administrator then kindly contact concern person/department.
Hi i have done with all the browser settings and the IE driver update my script ended with “Only local connections are allowed” but after that no browser launch and anything please help
issue only exists with the IE11 on earlier versions of IE its working properly
Hi Vinay,
Which version of Selenium and IE Driver version are you using? Moreover what exception message are you getting?
Many thanks for the help, this solved my problems with IE driver. Very helpful, regards from CO (:
Hi Cristian,
Glad to read from you…You’re always welcome to my blog…:)
Super helpful, thank you!!
If some one wants to be updated with most up-to-date technologies then he must be go to
see this web site and be up to date everyday.
Hi Johnnie,
Thanks for your apprerciation. I’ll try my level best to keep on updating with new topics.
Keep learning…:)
Hi Mukesh,
I am facing some issues with IE browser as my organization denied to check protected mode for Intranet and Trusted sites.
Hence unable to launch IE browser .Chrome and Mozilla is working fine .
Do you have any solution for this?
Please Let me know..
Thank you very much for your valuable videos .Really appreciate it.
is this fixed Afsar?
thank you so much Mukesh. I was facing issue 3. it solved.
Cheers Nidhi
mukesh first i was using 64 bit after that i dowload the 32 bit .. then also send key is not working..
but my all test case have been pass.
but in gui the sendkey is not working…
Strange it should work preetish.
Hi,
I am facing an issue in which when I am clicking on a button manually it opens a different window and when I do it through selenium it opens a different window but the link for both the windows are same.
How do I resolve this?
Hi Sonali,
In IE we can make such settings that open in new tab 🙂
You can also switch to new window using Selenium code. http://learn-automation.com/handle-dropdown-in-selenium-webdriver/
mukesh when i run my test on crome and firefox its runing smoothly all the testcase get pass
but when i run with Edge Driver below the exception is soing..
how to solve this:-
org.openqa.selenium.WebDriverException: Element is obscured
Edge is not mature enough for Selenium.
Hi Mukesh,
Greetings of the day!
I am unable to set pre-requirements for IE 11.
I don’t know where to do it.
“For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.
For 32-bit Windows installations, the key you must examine in the registry editor isHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE.
For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE.
Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.”
Can you please suggest me the steps to do it.
Thanks
Jaspal
Hi Jaspal,
Please follow below video for registry setting
Thank you Mukesh.
I sorted it out. Earlier, I found some trouble to open Registry Editor in Windows 10, but, later I got it.
Thanks
k Cheers
Hi Mukesh,
Thanks for the wonderful post.
I have been stuck with the issue-2 mentioned above ( ie sendKeys works very slow it takes 1-2 second to type each character) and tried all possible scenario’s from the past 3 days but no result.The sendKeys works very slow.
Here is my configuration.
OS : Windos 8, 64-bit
Internet Explorer version : version-11, 32 bit.
IEWebServer : 32 bit
IE setting : 1) Turned off all ‘Enable Protection mode’ from all zones.
2)Zoom set to 100%
3)Turned off ‘Enable enhance protection mode’ under Security category of ‘Advanced’ tab
Also, I have also tried with ‘IEWebServer’ 64 bit, it did not launch browser itself.
Please suggest if any other setting I missed and other possible issue.
Thanks,
Vijay
Hi Vijay,
IE Driver 32 bit always solves my problem.
I get ‘openqa.selenium.NoSuchWindowException’.
How can i fix this?
Hi Devari,
Please follow the below steps.
• For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor isHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.
hi mukesh, i am getting the NoSuchWindowExcp , i have tried the registry entry , but the program runs extremely slow. is there anything that needs to be done. also, i do not face this exception while running another test case on IE.
Hi Rony,
Please use 32 bit driver to make script run faster in System.
nice presentation
Thanks, Haritha hope you have fixed this IE issue.
very useful information i faced all the problems as you mention now i got the solution from your post now my ie browser working fine ………………………………..
thank u
Thanks Prasad, I am glad it worked for you.
Happy Weekend.