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,090 points
915 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,370 points
17,654 views
0 votes
1 answer
+2 votes
2 answers

How can we handle authentication popup in Selenium WebDriver using Java

You can use below code for selenium ...READ MORE

answered Jun 21 in Selenium by TEJAS KIRAN RATHI
15,566 views
0 votes
1 answer

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,510 points
2,899 views
0 votes
1 answer
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,237 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,890 points
2,367 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
3,800 views