Chrome 59是否支持URL中的基本身份验证凭据,以供Chromedriver使用? [英] Chrome 59 support for basic auth credentials in URLs alternative for usage with Chromedriver?

查看:116
本文介绍了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?

推荐答案

在我们的情况下(使用WebDriver通过C#和NTLM auth进行自动测试),我们发现,尽管您无法加载子目录,但只要您凭凭据访问该页面-页面上的资源,您仍然有权访问该浏览器会话.

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使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆