Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to test a web app that has BASIC authentication (there is a popup that comes up to authenticate the user when I hit whatever page, the popup is not part of the HTML). After entering the username/password and clicking OK on the popup the main login page appears.

Now, I need to a strategy to authenticate the user in Firefox on the popup. I tried the following looking at some old atricles in the Stack Overflow and this is not working for me.

Can some please guide me how to proceed? I have Selenium 2.5.0 installed and using python for scripting.

profile = webdriver.FirefoxProfile()
profile.set_preference("network.automatic-ntlm-auth.trusted-uris", "website url")
driver = webdriver.Firefox(firefox_profile=profile)
driver.get("http://username:password@WebsiteURL")
share|improve this question

1 Answer 1

up vote 1 down vote accepted

To get this user:password scheme working you need to set another preference:

profile.setPreference("network.http.phishy-userpass-length", 255);

Reference

Btw, you are using very old version of Selenium.

share|improve this answer
    
Hello Erki.. I have tried the avbove too and it didn't work for some reason. –  user3587233 6 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.