Problem with handling 'basic authentication' modal in selenium automation

95 views Asked by At

In one site, when I click a link it should open a login page. But, before loading the page it gives a popup that looks like an alert but in dev tools, it shows nothing. Also, the automation scripts return a 'no such alerts' error. I also can't find any locator for that popup using tools like Selenium IDE or selectors hub. Can anyone please help me understanding what type of element is this and how to handle this?

Note: if I cancel the popup then the login page loads.

enter image description here

UPDATE: When the modal appears the URL has a parameter like this- auth?client_id=[id]&redirect_uri=[url]&state=[a-hex-value]&response_mode=fragment&response_type=code&scope=openid&nonce=[a-hex-value]

1

There are 1 answers

5
Yaroslavm On

It's authentication modal. You can deal with it by using login and password, being defined in url https://username:password@URL

Example:

https://admin:[email protected]/basic_auth

Documentation