1

Click the link to see: pop up screenshot

I am trying to automate this:http://the-internet.herokuapp.com/basic_auth in chrome using Selenium java. I want to insert username, passwors and then either click sign in or cancel. But I am not able to "inspect element".

  • This will help you. Its an open bug as of now with selenium drivers. https://stackoverflow.com/questions/56303422/selenium-user-prompt-of-type-promptuserandpass-is-not-supported – rahul rai Aug 31 '20 at 04:27

2 Answers2

0

You need to switch the driver over to the alert:

driver.switchTo().alert().sendKeys("Some text");

You might be able to send the tab key to switch from username box to password box.

Aziz Sonawalla
  • 2,482
  • 1
  • 5
  • 6
0

It is window authentication pop-up, not javascript alert. So, in this case you need to modify Webdriver URL. (AutoIT also can be applicable. But below is the simple way to handle it.)
say, username=admin, password=admin. Just pass the below URL:

driver.get("http://admin:admin@the-internet.herokuapp.com/);
arpita biswas
  • 144
  • 1
  • 6