0

How to handle authentication pop up in chrome browser by using selenium web driver?

James Z
  • 12,209
  • 10
  • 24
  • 44
  • Welcome to the Stack overflow. Go through the general guide line on how and when to ask question on the forum. [Help Center >> Asking](https://stackoverflow.com/help/asking) and [How to ask Question](https://stackoverflow.com/help/how-to-ask). – Alok Nov 03 '18 at 08:10
  • This question has already been answer on the forum. [Here is the link](https://stackoverflow.com/questions/42114940/how-to-handle-authentication-popup-in-chrome-with-selenium-webdriver-using-java) and on the other website [link1](https://www.seleniumeasy.com/selenium-tutorials/how-to-handle-authentication-popup-in-selenium-webdriver) [link2](https://www.softwaretestingmaterial.com/handle-authentication-popup-window/). People on the forum really appreciate doing some research from your end before asking a question. – Alok Nov 03 '18 at 08:12

1 Answers1

0

Try:

  WebDriver driver =  new ChromeDriver(options)
  driver.get("http://username:password@www.domain.com");

or

ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=/path/to/your/custom/profile");
WebDriver driver =  new ChromeDriver(options);
driver.navigate().to(testURL);

References:

https://sites.google.com/a/chromium.org/chromedriver/capabilities https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md

Rafael
  • 601
  • 7
  • 10