问题描述
在 Chrome 59 中,对将基本身份验证凭据放入 URL 的支持 - 例如 https://foo:bar@www.foo.com 已经结束 - 不久前在 https://www.chromestatus.com/feature/5669008342777856.
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.
有没有人不得不使用 Selenium 和 Chromedriver 解决这个问题?特别是在 Python 中?
Has anyone had to work around this with Selenium and Chromedriver yet? Specifically within Python?
推荐答案
在我们的情况下(通过 C# 和 NTLM auth 使用 WebDriver 进行自动测试),我们发现一旦您使用凭据点击页面,尽管您无法加载子-您仍然有权访问该浏览器会话的页面上的资源.
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.
这篇关于Chrome 59 是否支持 URL 中的基本身份验证凭据,以便与 Chromedriver 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)