我们的网络应用需要Windows身份验证。我有一个NUnit测试
FirefoxDriver
并导航到网络应用。不幸的是,它甚至没有要求凭据就会出现401.0 - Unauthorized
错误。我习惯了Firefox要求凭据,在这种情况下你可以添加
profile.SetPreference("network.ntlm.send-lm-response", true);
profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", "localhost");
但出于某种原因,我只是立即使用登录用户:匿名获得401。
如何告诉Selenium / Firefox使用集成安全性?看看Windows任务管理器,我发现Firefox进程是“像我一样”启动的。
答案 0 :(得分:1)
咄。我正在编辑错误的applicationhost.config
。在64位操作系统上,相关的配置文件是C:\Program Files\IIS Express\AppServer\applicationhost.config
(不是C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config
,我的不幸也存在)。
其中,我启用了Windows身份验证并禁用了匿名身份验证。然后Firefox开始要求提供凭据,然后我可以在传递给network.automatic-ntlm-auth.trusted-uris
的个人资料中设置FirefoxDriver
,如我所述。