Chrome 59 support for basic auth credentials in URLs alternative for usage with Chromedriver?

China☆狼群 提交于 2019-11-30 18:23:54

问题


With Chrome 59 the support for putting basic auth credentials in URLs - like https://foo:bar@www.foo.com has ended - this was warned a while ago within https://www.chromestatus.com/feature/5669008342777856.

Has anyone had to work around this with Selenium and Chromedriver yet? Specifically within Python?


回答1:


In our situation (automated testing using WebDriver via C# with NTLM auth) we found that once you hit the page with the credentials although you can't load the sub-resources on the page you are still authorized for that browser session.

So we go to a page that we don't want to test (in our case the home page) with valid credentials in order to get authorized at the start of our test suite. From then on we browse to the pages we want to test without any credentials and so long as we don't close the session everything works.



来源:https://stackoverflow.com/questions/44531972/chrome-59-support-for-basic-auth-credentials-in-urls-alternative-for-usage-with

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!