Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
277 views
by Contributing Tester (20 points)
retagged by

I need give the Apache authentication using java script. I have tried some different ways but its not working. Is anybody have had this type of experience please let me know the way of doing this. If there is any other way to handle please mention that as well. Thanks 

1 Answer

1 like 0 dislike
by The go-to Tester (181 points)
selected by
 
Best answer
In Firefox, you can use Firefox profile as given below and send username and password in URL

FirefoxProfile ffProfile = new FirefoxProfile();
ffProfile.setPreference("network.automatic-ntlm-auth.trusted-uris", "hostname");
WebDriver driver = new FirefoxDriver(ffProfile);
driver.get("http://username:password@hostname");  

Hope that helps!


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...