Chrome 59 support for basic auth credentials in URLs alternative for usage with Chromedriver?(Chrome 59 是否支持 URL 中的基本身份验证凭据,以便与 Chromedriver 一起使用?)
问题描述
在 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 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Chrome 59 是否支持 URL 中的基本身份验证凭据,以便与 Chromedriver 一起使用?


基础教程推荐
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 包装空间模型 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01