how to stop webdriver.Firefox from asking for login (python script running on Window 7)

240 views
Skip to first unread message

Randy Harding

unread,
Feb 12, 2015, 7:42:16 AM2/12/15
to seleniu...@googlegroups.com
When I connect to a website manually in FireFox on my local corporate intranet site, I am not asked for a login.

When I create a script and call driver.get for the same site,  a box pops up and asks for a login.  How do I prevent this?

I have not created profiles in Firefox.  There is only the default stored at

C:\Users\john.doe\AppData\Roaming\Mozilla\Firefox\Profiles\50u5oy88.default

I assumed this is used automatically by FireFox even when called by Selenium, but maybe this is not the case.

I am using FireFox v35.01 (latest version) and python 3.4.2 on Windows 7 Professional.

Hopefully I posted enough information, otherwise let me know.   This is corporate data, so I cannot post actual information.

Jonathan Taylor

unread,
Feb 13, 2015, 3:41:38 PM2/13/15
to seleniu...@googlegroups.com
Have you researched the Alert class in WebDriver
IAlert ToJoin = AUT.Browser.SwitchTo().Alert();
           ToJoin.Accept();

If your username and password are saved through firefox this has worked for me in the past.  Depending on your website you can pass the username and password into the URL.   

https://gooduser:secretpassword@www.example.com/webcallback?foo=bar

Ronald Jensen

unread,
Feb 19, 2015, 5:27:31 PM2/19/15
to seleniu...@googlegroups.com


On Thursday, February 12, 2015 at 5:42:16 AM UTC-7, Randy Harding wrote:
I have not created profiles in Firefox.  There is only the default stored at

C:\Users\john.doe\AppData\Roaming\Mozilla\Firefox\Profiles\50u5oy88.default

As I understand it, selenium creates a profile on-the-fly for firefox. You can force a profile by using something like this C# snippet:
            string path = @"C:\Users\john.doe\AppData\Roaming\Mozilla\Firefox\Profiles\50u5oy88.default";
            FirefoxProfile profile = new FirefoxProfile(path);

            driver = new FirefoxDriver(profile);
 
Reply all
Reply to author
Forward
0 new messages