0

I am creating Python script for a website involving pop up sign in.

Tried the below code and getting an error message

 alert = driver.switch_to.alert
 alert.send_keys('username')

Error - Message: User prompt of type promptUserAndPass is not supported

How to resolve this error? any other way to input credentials for the pop up sign in?

James Z
  • 12,209
  • 10
  • 24
  • 44
  • It sounds like it's requiring Basic auth. Instead of trying to interact with the prompt, you can just include it in the URL like `https://username:password@host.example.com/` and that works the same way as typing it in the basic auth prompt. – sytech Mar 14 '23 at 19:11
  • Thanks, but it is not working. Also username includes Domain as well. – Arunkumar Mar 15 '23 at 14:47

1 Answers1

0

This is caused by lack of implementation in the driver for basic auth prompt.

Driver implementation has been blocked by a gap in the standards (see here for info https://github.com/w3c/webdriver/issues/385)

As per a comment, there are other ways to send basic auth details.

  • In URL: https://{username}:{password}@host.example.com/ (if you have a domain in username, then include this e.g. name@domain.com:password@host.example.com
  • In Header: "Authorization: Basic {String}" (Where {String} is Base64 encoded "{username}:{password}")

(Both possible using requests library which is present in AppDynamics Synthetics by default)

(Make sure you use URL Encoding if using the URL method.

Ingmar Boddington
  • 3,440
  • 19
  • 38