3

I'm trying the below code. But its still giving dialog box for entering username and password when firefox browser starts. Where am I wrong?

FirefoxProfile profile = new FirefoxProfile();
Proxy firefox_proxy = new Proxy();
firefox_proxy.HttpProxy = proxy;
firefox_proxy.SslProxy = proxy;
profile.SetProxyPreferences(firefox_proxy);

Firefoxdriver driver = new FirefoxDriver(new FirefoxBinary(), profile, TimeSpan.FromMinutes(3));
driver.Navigate().GoToUrl("http://" + proxy_username + ":" + proxy_password + "@www.xyz.com/");
diiN__________
  • 7,393
  • 6
  • 42
  • 69
Sid
  • 327
  • 1
  • 2
  • 13

1 Answers1

0

You should try with https:// instead of http:// as on some sites the Basic Authentication works on secure network only.

Syntax: driver.Navigate().GoToUrl("https://proxy_username:proxy_password@www.xyz.com/");

Pankaj Dubey
  • 279
  • 2
  • 18
  • Did you try doing the same manually. I think if this program doesn't work then it won't work manually as well but give it a try. Or you can share the details with me privately and I'll try it at my end if it's not that confidential. – Pankaj Dubey Apr 26 '16 at 06:48
  • The problem is, passing the username and password in the URL is used to pass credentials to the site being accessed as a basic authentication header. I don't believe it uses those same credentials to authenticate to the proxy. – BardMorgan Feb 15 '18 at 18:53