1

I have tried https://{USERNAME}:{PASSWORD}@xyz.com pattern to authenticate URL but it doesn't work for me.

Can someone suggest me the best way to handle chrome HTTP authentication popup?

1

Authentication via the URL has been deprecated for a while:

While this may sound like a thunder from clear skies for Chrome users, it is not. The deprecation “order” comes from RFC 3986: ...

3.2.1. User Information ... Use of the format "user:password" in the userinfo field is deprecated.

https://medium.com/@lmakarov/say-goodbye-to-urls-with-embedded-credentials-b051f6c7b6a3

There is an issue on GitHub to get this into WebDriver W3Cspecs: Missing support for HTTP authentication prompts #385

You could try to use the argument --disable-blink-features="BlockCredentialedSubresources" to re-enable basic auth via the URL as described in this answer: https://stackoverflow.com/questions/57192562/passing-basic-auth-credentials-in-google-chrome-shows-the-pop-again

1

Despite you have chosen Niels answer as correct, I would also suggest a way to work around your issue.

What you're talking about is likely a "basic authentication". The best way to bypass this step is to add Authorization header to HTTP requests which are sent by your browser. To do that you need to set up some proxy which would add mentioned header with the value Basic userNameEncoded:passEncoded where userNameEncoded:passEncoded is the pair of your credentials encoded in Base64.

You can use some lightweight proxy like browsermob-proxy. Here you can find some examples of how to configure it for Java case. As far as I know the proxy has wrappers for Python and probably some other languages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.