11

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).
1
  • If you try to navigate to some other site, does it work? It may have to do with using http... Also, when you say you have set "Enable Protected Mode", you mean you are disabling it, correct? Also, try playing with the settings in Internet Options>Advanced under Security section Commented Jul 8, 2016 at 16:28

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

If I try this I get a 404-error in the webdriver.Remote line. I also stronly prefer to get a driver as given in my example code, i.e. to have a method that returns the correct and working driver (without the need to specify a specific URL beforehand...).
@Alex the custom command_executor url here is just because I am on mac and using the remote browserstack selenium server and firing up IE there. Then, I navigate to the particular httpwatch page just to demonstrate that I can access the image behind the basic http auth. Note that if you want to run this example, you need to replace username and key with your specific browserstack credentials.
I don't want to use browserstack... Maybe selenium just does not work for IE on purpose?
0

Have you tried using it this way ?

driver.current_url("http://user:[email protected]")

2 Comments

Seems like 'current_url' is a string which I cannot call. I get an error TypeError: 'str' object is not callable ...
Do you mind sharing a few more details ? Like >What version of python you're using ? >Which header imports have you called in the program ? >Basically post your entire code if possible ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.