0

I'm trying to automate a secure application(with useragent - iphone) which asks for authentication when i open the site. I tried giving the credentials in the URL itself to bypass the authentication but it pops up a dialogbox for confirmation which i'm unable to handle it through code.

FirefoxProfile profile = new FirefoxProfile();     
profile.setPreference("general.useragent.override",
    "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1"
    + "(KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3)"); 
WebDriver driver = new FirefoxDriver(profile); 
String site = "http://akamai:ecnt0k3n@ecn13-secure-store.nike.com";
driver.get(site);

Any help on this is highly appreciated.

Thanks, Bhavana

Alberto
  • 5,021
  • 4
  • 46
  • 69
Bhavana
  • 95
  • 3
  • 5

2 Answers2

2

Mozilla blocks fishing attempts. Did you check Network.http.phishy-userpass-length?

By the way, according to Selenium's issue 34#8, this should work:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.http.phishy-userpass-length", 255);
driver = new FirefoxDriver(profile);
driver.get("http://username:password@www.basicauthprotected.com/");

Note: this question is almost the same as BASIC Authentication in Selenium 2 - set up for FirefoxDriver, ChromeDriver and IEdriver.

Community
  • 1
  • 1
Alberto
  • 5,021
  • 4
  • 46
  • 69
0

You can use Selenium's new WebDriver to enter information into a dialog box of that type. However I haven't done it.

m4tt1mus
  • 1,642
  • 14
  • 24