-1

enter image description here

Try to automate a website that you need to login to an IP address. When you navigate to the IP address, a popup login alert will display, but you can not inspect the alert (right-click does not do anything) and can not get any web elements of the alert.

I have tried to print all the elements, but it is only printing the parent page element which is HTML, head, body.
when I use the driver.switchTo().alert(), it returns selenium.NoAlertPresentException: no such alert

How can I automate this scenario with selenium?

UnknownBeast
  • 979
  • 1
  • 6
  • 13
Nunu
  • 15
  • 2

1 Answers1

0

It is a kind of authentication pop up that you are getting from the server and you can't handle it with the help of any selenium locators.

If you have username and password then pass it in the URL as follows.

https://username:password@url.com

password must be encoded as per the URL as if you have @ in your password then it won't work properly.

You can even use AutoIT and Sikuli to handle such pop ups. If you face any issue then please let me know :)

UnknownBeast
  • 979
  • 1
  • 6
  • 13
  • I can log in right now but it is not fully accessed. I think I need to try to make the password encoded. Can I ask how can I make password encoded? – Nunu Jun 12 '20 at 17:52
  • If that has resolved you pop up issue then I request you to mark this answer as accepted my friend. Reputation points encourage us to help people. Let's talk about the issue that you are facing now. Could you please tell exactly what is happening after you redirect to the page. – UnknownBeast Jun 12 '20 at 18:39