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,020 points
699 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,420 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,270 points
7,275 views
0 votes
1 answer
+2 votes
1 answer

How can we handle authentication popup in Selenium WebDriver using Java

The Alert Method, authenticateUsing() lets us skip ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,650 points
8,461 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,110 points
918 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,130 points
1,104 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,130 points
840 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,420 points
2,351 views