Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the IE webdriver from selenium for python (Failed to navigate error)?

I am trying to use the python-selenium API (version 2.53.6) to perform GUI tests on different browsers. When I try to use IE (11.0.10240) in the following way (Windows Server 2012 R2 Standard, 64bit); using authentication:

driver = webdriver.Ie()
driver.get("http://user:[email protected]")

then I get the following error message:

selenium.common.exceptions.WebDriverException: Message: Failed to navigate to http://user:[email protected]. This usually means that a call to the COM method IWebBrowser2::Navigate2() failed.

Is there a way to fix this error?

Addendum:

  • I have been trying to use the 32bit version of the IE driver, no success (same error)
  • I have changed the registry as explained here, no success (same error)
  • I have set "Enable Protected Mode" for all zones (also suggested here).
like image 251
Alex Avatar asked Jul 06 '16 13:07

Alex


People also ask

What is the WebDriver for Internet Explorer?

Download the WebDriver tool WebDriver implements many of the high priority features from the W3C spec to let developers open a session, automate basic functionality against the pages, and then return the results of the tests.

Which Internet Explorer version does Protected Mode settings are needed by the Internet Explorer driver?

IE 7 on Windows Vista introduced the concept of Protected Mode, which allows for some measure of protection to the underlying Windows OS when browsing.


1 Answers

Not directly answering the question, but I could not reproduce it when using IE11 on Windows 10 through BrowserStack and opening this http auth protected page:

from selenium import webdriver

desired_cap = {'os': 'Windows', 'os_version': '10', 'browser': 'IE', 'browser_version': '11.0'}

driver = webdriver.Remote(
    command_executor='http://usename:[email protected]:80/wd/hub',
    desired_capabilities=desired_cap)

driver.get("http://httpwatch:[email protected]/httpgallery/authentication/authenticatedimage/default.aspx?0.7349707232788205")

No errors and I see the image that is behind the HTTP auth.

Using selenium 2.53.5.

like image 56
alecxe Avatar answered Oct 24 '22 13:10

alecxe