in Selenium by
Q:
How to Login into any site if it is showing an Authentication Pop-Up for Username and Password?

▼ Show 2 Answers

0 votes
by
To do this we pass username and password with the URL

http://username:[email protected]

e.g. http://myUserName:[email protected]

1

2

http://username:[email protected]

e.g. http://myUserName:[email protected]
0 votes
by

To handle authentication pop-ups, verify its appearance and then handle them using an explicit wait command.

Use the explicit wait command

  WebDriverWait wait = new WebDriverWait(driver, 10);

Alert class is used to verify the alert

   Alert alert = wait.until(ExpectedConditions.alertIsPresent());

Once verified, provide the credentials

  alert.authenticateUsing(new UserAndPassword(<username>, <password>));

Selenium
Learn More with Madanswer

Related questions

0 votes
asked Aug 22, 2019 in Selenium by john ganales
...