简体   繁体   English

如何使用 Selenium Webdriver 和 Internet Explorer 10 处理 Windows 身份验证?

[英]How to handle Windows Authentication with Selenium Webdriver and Internet Explorer 10?

I have issues to get through the windows authentication when creating an automation test (C#) with Selenium Webdriver using the InternetExplorer Driver.在使用 InternetExplorer 驱动程序使用 Selenium Webdriver 创建自动化测试 (C#) 时,我在通过 windows 身份验证时遇到问题。

(When using Firefox it works to access https//username:password@site.com but not with Internet Explorer 10 (windows 7) ) (使用 Firefox 时,它可以访问 https//username:password@site.com 但不能使用 Internet Explorer 10(Windows 7))

I tried to update windows registry according to this article but it didnt work for IE10: http://aleetesting.blogspot.se/2011/10/selenium-webdriver-tips.html我尝试根据这篇文章更新 windows 注册表,但它不适用于 IE10: http://aleetesting.blogspot.se/2011/10/selenium-webdriver-tips.ZFC356FDC70D5FCA769

Can any friendly person help me with a good solution how to get through Windows authentication using https//username:password@site.com in IE10?任何友好的人都可以帮助我解决如何在 IE10 中使用 https//username:password@site.com 通过 Windows 身份验证吗?

Or does anyone have a better way to handle windows authentication issue with Selenium webdriver?或者有没有人有更好的方法来处理 Selenium webdriver 的 windows 身份验证问题?

Best Regards Carl最好的问候卡尔

In Windows 7 you can use the Credentials Manager to save the credentials for your site in the vault. 在Windows 7中,您可以使用凭据管理器在Vault中保存站点的凭据。 The authentication now goes automatic. 身份验证现在自动进行。

Just configure your system to allow windows authentication without prompting只需将您的系统配置为允许 windows 身份验证而不提示

Add your site into the Trusted Sites zone in Internet Properties and set "Automatic logon with current user name and password" in Local Intranet and Trusted Sites zones.将您的站点添加到 Internet 属性中的受信任站点区域,并在本地 Intranet 和受信任站点区域中设置“使用当前用户名和密码自动登录”。

Here are the steps to configure this:以下是配置它的步骤:

Search for the Internet Options tool on your system and launch it.在您的系统上搜索 Internet 选项工具并启动它。

Click the 'Security tab > Trusted Sites icon', then click the 'Sites' button and enter the URL of your Trusted Site, then click Add.单击“安全选项卡 > 受信任站点图标”,然后单击“站点”按钮并输入受信任站点的 URL,然后单击添加。 This should be the site under test.这应该是被测站点。

Click 'Close' to close the Trusted Sites window.单击“关闭”以关闭受信任的站点 window。

Click on 'Security tab > Local intranet' then the 'Custom level...' button.单击“安全选项卡 > 本地 Intranet”,然后单击“自定义级别...”按钮。

Scroll to the bottom and select the 'Automatic logon with current user name and password' option.滚动到底部并 select 选择“使用当前用户名和密码自动登录”选项。 It's under the 'Authentication > Logon' section.它位于“身份验证 > 登录”部分下。

Click OK to save the changes.单击确定以保存更改。

Repeat steps 6 and 7 for the 'Trusted Sites' zone also.对“受信任的站点”区域也重复步骤 6 和 7。

Click OK to save all the changes and close the Properties window.单击确定保存所有更改并关闭属性 window。

暂无
暂无

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

相关问题 如何使用Selenium Webdriver在Internet Explorer上获取Cookie-C# - How to get cookies on internet explorer using Selenium webdriver - C# 如何使用带有 selenium webdriver 的 Windows 文件资源管理器选择多个文件 - How to select many files using Windows file explorer with selenium webdriver 使用 Selenium Webdriver 处理 Windows 身份验证 - Handling Windows authentication with Selenium Webdriver 使用Selenium的完整Internet Explorer身份验证对话框 - Complete Internet Explorer Authentication Dialog with Selenium Selenium Webdriver无法访问Internet Explorer 8上的Web元素-显示为已禁用 - Selenium Webdriver unable to access web element on Internet Explorer 8 - shown as disabled Selenium WebDriver Internet Explorer IEDriverServer阻止模态对话框 - Selenium WebDriver Internet Explorer IEDriverServer Blocks Modal Dialog 使用Internet Explorer 11的多个Selenium Webdriver实例会相互干扰 - Multiple selenium webdriver instances using Internet Explorer 11 interfere with eachother C#Selenium Webdriver在Internet Explorer中捕获javascript错误 - C# Selenium webdriver Catch javascript errors in Internet explorer 如何在Selenium Webdriver中处理不同的浏览器(Safari,Chrome,Internet Explorer和Opera)。 需要安装哪种库? - How to deal with different browsers (Safari, Chrome, Internet explorer and opera) in selenium webdriver. What kind of libraries needs to be installed? 硒和Internet Explorer驱动程序 - Selenium and Internet Explorer Driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM