Performing authentication for FirefoxDriver, ChromeDriver and IEDriver using Selenium WebDriver

0 votes

I am using FirefoxDriver and Chrome-Driver. I am trying to test a web application that has authentication part. I want to authenticate the user in Firefox, Chrome and IE.

I used the below code:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.http.auth-userpass-length", 225);
WebDriver driver = new FirefoxDriver(profile);
driver.get("http://username:password@username");  

It is not working for me.

May 9, 2018 in Selenium by Perry
• 17,100 points
1,032 views

1 answer to this question.

0 votes

Use the below code for firefox:

profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", "google.com");
driver = new FirefoxDriver(profile);

driver.Navigate().GoToUrl("http://user:pwd@google.com");
answered May 9, 2018 by Meci Matt
• 9,460 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Using gettext() method for the specific element using Selenium WebDriver

Mistake is that u r printing the ...READ MORE

answered Apr 10, 2018 in Selenium by Vardy
• 2,360 points
22,133 views
0 votes
1 answer
+2 votes
3 answers

How can we handle authentication popup in Selenium WebDriver using Java

1) By passing user credentials in URL. String ...READ MORE

answered Aug 30 in Selenium by Sri
• 2,970 points
18,339 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,520 points
3,774 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,758 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,735 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
3,098 views
0 votes
1 answer
0 votes
1 answer

Is it possible for a website to detect that we are using Selenium with ChromeDriver

Selenium tests for pre-defined javascript variables which ...READ MORE

answered Apr 27, 2018 in Selenium by Meci Matt
• 9,460 points
4,324 views