TransWikia.com

login for https url having https different url for browser popup in selenium python

Software Quality Assurance & Testing Asked by Satya Mishra on October 25, 2021

I have url https://dc1-common.naops.exu.xxxx.se/cgi-bin/index.pl and after entering I got another url https://dc1-common.naops.exu.xxxx.se with Sign In Browser pop up which requires for Authentication

I tried with https://username:[email protected]/cgi-bin/index.pl , it does not work

If I convert url to http than it works . Please provide the solution for https based url which requires

2 Answers

This guy properly explains why you can't do that anymore -

“Say goodbye to URLs with embedded credentials” by Leonid Makarov https://link.medium.com/eSAHV8Sfq7

PS: you might want to use https://rungutan.com instead. They support a "login" property for your logic of having "different URL" that can help you.

Answered by Marius Mitrofan on October 25, 2021

Doing basic auth via the url isn't supported by most browsers these days and once the pop up happens, now the Operating System has control of the browser and your browser-based tests can't do anything. A few options come to mind:

IF this is a site you control (or your company) controls you can try disabling the authentication:

  1. Whitelist your IP so you don't have to login
  2. Set a cookie bypass

If you don't have control of this site:

  • You can try making an API call in your test with the correct headers / authentication. Return the authenticated session and then proceed with your test.

I had a similar problem and was able to use option 1 which involved whitelisting the IP addresses of the AWS machines I run my tests on. Option 2 was also a possibility.

Answered by Chris Kenst on October 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP