Raghu P
Raghu P

Reputation: 65

Selenium Webdriver with Chrome browser not displaying authentication pop-up

I am automating an internal application of my client which is having LDAP authentication. I am using Selenium 3.141.59 with C#, Chrome browser 78.

Issue: When I have open browser manually and place url then browser displaying sign-in Pop-up to enter the userID and password. (refer screenshot) enter image description here

Same time when Selenium launch browser instance then navigate to same url, it's not showing any sign-in pop-up.
Due this I was unable to continue next steps in automation.

I have tried send the userID and password along with url as blow but it's also not redirecting. https://userID:password@url

Can anyone help me, how to resolve this issue.

Upvotes: 0

Views: 478

Answers (1)

Alexey R.
Alexey R.

Reputation: 8676

What you have tried is not supported any more. You now have to include authentication headers in requests. In your case I would recommend to set up a proxy which would add headers to all outcoming messages of your browser

For example you can use Browsermob Proxy that you can configure just in your tests. Some details of how basic authentication works you can find here. It is solution for Java, however you can find which headers to set up and which values to assign (In short: header - Authorization: Basic username:password Realm="" where username:password is credentials pair encoded in Base64).

This also might be useful for you: How do I encode and decode a base64 string?

UPD: This is solution for Python Selenium.

Upvotes: 1

Related Questions