I am using Selenium to write test cases for my web application. When I run the test from Firefox it\'s working fine, but when I try to run it from IE I am not able to run an
I resolved this issue by manually running internet explorer. When the browser loaded, I was prompted with a dialog to 'Set up Internet Explorer 11'. I selected 'Use recommended security, privacy, and compatibility settings' and clicked 'OK'.
After the dialog closed, my browser displayed a configuration page called 'Caution: Internet Explorer Enhanced Security Configuration is not enabled' - I ignored this and closed the browser and tried running the automation test again with success.
I've just encountered that problem myself. For me, the problem was that my application uses HTTP Basic Authentication, and that I was attempting to set the username/password combination via the page URL, like this: http://username:password@host/path
Problem is by default IE doesn't allow you to set the username and password this way (it's a security feature), and that causes the error above.
To fix this, I had to add a registry value in regedit. In the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE
add a new DWORD
value with the name iexplore.exe
and the value 0
, as described in this other answer https://stackoverflow.com/a/23519791/80779
You must set the Protected Mode settings for each zone to be the same value in the Internet Explorer. Hope the below link may be helpful to you.
NoSuchElementException is occurred during implementation of InternetExplorerDriver in Selenium WebDriver
Regards,
Vignesh
This error message...
org.openqa.selenium.WebDriverException: This usually means that a call to the COM method IWebBrowser2::Navigate2() failed
...implies that the IEDriverServer was unable to initiate/spawn a new Browsing Context i.e. Internet Explorer Browser session as a COM object.
@JimEvans in a article You're Doing It Wrong: IE Protected Mode and WebDriver mentioned, while automating internet-explorer through iedriverserver:
A browser session was represented by a single instance of the iexplore.exe executable. A framework for driving IE could instantiate the browser as a COM object using CoCreateInstance(), or could easily get the COM interfaces to a running instance by using the presence of ActiveAccessibility and sending a
WM_HTML_GETOBJECT
message to the appropriate IE window handle. Once the framework had a pointer to the COM interfaces, you could be sure that they'd be valid for the lifetime of the browser. It also meant you could easily attach to the events fired by the browser through the DWebBrowserEvents2 COM interface.Then along came the combination of IE 7 and Windows Vista. In and effort to reduce the attack surface presented by malicious web sites, IE 7 introduced something called Protected Mode, which leveraged Mandatory Integrity Control in Windows Vista to prevent actions initiated IE, usually initiated by JavaScript, from being able to access the operating system the way it could in prior releases. While this was generally a welcome development for most users of IE, it created all manner of problems for automating IE. When you cross into or out of Protected Mode by, say, navigating from an internal intranet website to one on the internet, IE has to create a new process, because it can't change the Mandatory Integrity Control level of the existing process. Moreover, in IE versions after 7, it's not always obvious that a Protected Mode boundary has been crossed, since IE tries to present a better user experience by seamlessly merging the browser window of the new process with the already opened browser window. This under-the-covers process switching also means that any references pointing to IE's COM objects before the Protected Mode boundary crossing are left pointing to objects that are no longer used by IE after the boundary crossing.
Further, the Required Configuration of Internet Explorer Driver clearly mentions:
IEDriverServer
exectuable must be downloaded and placed in your PATH.Advanced
tab of the Internet Options dialog.100%
so that the native mouse events can be set to the correct coordinates.100%
in display settings.HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
.HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
.FEATURE_BFCACHE
subkey may or may not be present, and should be created if it is not present. Inside this key, create a DWORD
value named iexplore.exe
with the value of 0`.First, you need to ensure that the Protected Mode settings for each zone to be the same value. Additionally you also need to ensure the Required Configuration for Internet Explorer Driver.
You can find a couple of relevant discussions in: