简体   繁体   English

如何在 Safari 浏览器中使用 selenium 处理基本的 url 身份验证

[英]How to handle basic url authentication using selenium in Safari browser

In chrome below solution is working:在下面的 chrome 中,解决方案正在运行:

driver.get("https://username:password@something.com");

In firefox below solution is working:在 Firefox 中,以下解决方案有效:

driver.get("https://username:password@something.com);

and then:进而:

driver.get("http://something.com");

In safari both of the above solutions are not working.在 safari 中,上述两种解决方案都不起作用。 I have also tried with Alert class in selenium.我也尝试过使用硒中的警报类。 Googled a lot, still did not find any solution working.谷歌搜索了很多,仍然没有找到任何有效的解决方案。 Any solution which can be used across all browsers would be awesome ;), solution for safari alone is also fine.任何可以在所有浏览器上使用的解决方案都很棒;),单独的 safari 解决方案也很好。 Thanks in advance.提前致谢。

Neither of these approaches is expected to work;预计这些方法都不会奏效; browsers have stopped accepting user:password for Basic Authentication, so it doesn't work under WebDriver control either.浏览器已停止接受用户:密码进行基本身份验证,因此它也无法在 WebDriver 控制下工作。 The WebDriver Working Group is aware of this functionality gap but hasn't proposed a solution yet :( WebDriver 工作组意识到了这个功能差距,但尚未提出解决方案:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在没有 autoit 和 url 方法的情况下使用 java 处理带有 selenium webdriver 的浏览器的身份验证警报 - How to handle authentication alert of browser with selenium webdriver using java without autoit and url method 如何使用 Selenium Webdriver 处理浏览器身份验证弹出窗口 - How to Handle Browser Authentication popup using Selenium Webdriver Selenium - 通过 url 进行基本身份验证 - Selenium - Basic Authentication via url 使用Selenium的浏览器身份验证 - Browser Authentication using Selenium 如何在Java中处理基本身份验证 - How to Handle Basic Authentication in java 如何使用 Java 在 Selenium Webdriver 中处理 HTTP Basic Auth 标头? - How to Handle HTTP Basic Auth headers in Selenium Webdriver using Java ? 如何使用chrome驱动程序使用Java覆盖selenium2中的基本身份验证? - How to override basic authentication in selenium2 with Java using chrome driver? 如何使用RESTEasy显示用于基本身份验证的浏览器登录表单 - How to show browser login form for basic authentication using RESTEasy 如何在Selenium中处理身份验证标头? - How to handle Authentication header in Selenium? 如何使用Selenium Webdriver代码处理基本身份验证(Rest API-发布请求)? - How to handle the basic authentication (Rest API- Post Request) with selenium webdriver code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM