0

Lets say for example that I have page A that prompts for HTTP Basic Auth.

If correct login credentials are provided, user is redirected to another B site that has another HTTP Auth.

How would you go about doing that?

I can access 1st page via user:pass@domain url, but I cannot go further than that (get trough the second auth).

Only idea I have is to use http multipass extension in chrome, but I do not know how to load it with data before running tests.

Any suggestions?

2 Answers 2

1

You can add an extension when creating the WebDriver:

options = webdriver.ChromeOptions()
options.add_extension('./exampleOfExtensionDownloadedToFolder.crx')
driver = webdriver.Chrome(chrome_options=options)
1
  • @phoez, you find the answer satisfying, could you click on the Accept button? Commented Jan 28, 2019 at 20:00
0

A method I have used previously is to navigate to the URL of the second page with the credentials before starting the journey, so you aren't asked when you are redirected.

e.g. Navigate to user:pass@domain2

You'll most likely get some error on the page as you normally get to the page as an authorised customer

Navigate to user:pass@domain

Complete your journey, and the credentials from the first navigation should be remembered when you are redirected to domain2 and no prompt should appear

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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