简体   繁体   English

如何使用Selenium处理Windows身份验证

[英]How do I handle a Windows Authentication using Selenium

I am attempting to automate a process using selenium with Java. 我正在尝试使用硒与Java来自动化过程。 I am trying to navigate to a URL, which the test does do. 我正在尝试导航到URL,测试确实做到了。 A screen pops out over the top of Firefox asking for a user name and password. Firefox顶部弹出一个屏幕,询问用户名和密码。 When this screen pops out, firebug stops working and I cannot get any information about this screen. 当此屏幕弹出时,萤火虫停止工作,并且我无法获得有关此屏幕的任何信息。

How do I handle a modal dialogue with Selenium, when I cannot find anything about it? 当我找不到与硒有关的模态对话时,该如何处理?

I guess, that you are trying to get to HTTP Authentification protected page. 我想,您正在尝试访问受HTTP身份验证保护的页面。 Try getting here like this: 尝试像这样到达这里:

driver.get("http://username:password@your-site.com");

Where driver is assumed as healthy and living instance of WebDriver 假设driverWebDriver健康存在实例

This actually did not work, the dialog still displays. 这实际上不起作用,对话框仍然显示。 Instead of running the tests in Firefox as I had wanted I ran them in IE which was using NTLM so I didn't need to input my information. 而不是像我希望的那样在Firefox中运行测试,而是在使用NTLM的IE中运行了这些测试,因此无需输入信息。

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

相关问题 如何使用Selenium WebDriver处理HtmlUnitDriver的身份验证? - How do I handle authentication with the HtmlUnitDriver using Selenium WebDriver? 如何使用 Java 处理 Selenium 的代理身份验证? - How do I handle Proxy Authentication with Selenium using Java? 如何使用python(加上java)处理selenium中的windows身份验证弹出窗口 - How to handle windows authentication popup in selenium using python(plus java) 如何使用JAVA在Selenium Webdriver的Internet Explorer中处理服务器身份验证弹出窗口? - How can i handle Server authentication pop-up in Internet Explorer in Selenium Webdriver using JAVA? 如何在Selenium中处理身份验证标头? - How to handle Authentication header in Selenium? (StaleElementException:Selenium)我该如何处理? - (StaleElementException:Selenium) How do I handle this? 如何使用 Selenium Webdriver 处理浏览器身份验证弹出窗口 - How to Handle Browser Authentication popup using Selenium Webdriver 如何使用python处理Selenium WebDriver的身份验证弹出窗口? - How to handle authentication popup with Selenium WebDriver using python? 如何使用硒在Mozilla FireFox中处理代理身份验证? - How to handle proxy authentication in mozilla firefox using selenium? 如何使用 Java 处理 Selenium WebDriver 的身份验证弹出窗口 - How to handle authentication popup with Selenium WebDriver using Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM