IE Windows安全性对话框似乎阻止Selenium导航 [英] IE Windows Security dialog appears to block Selenium navigation

查看:254
本文介绍了IE Windows安全性对话框似乎阻止Selenium导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10上使用C#中的Selenium。受测试的网站应该使用IE中的Windows安全登录框进行挑战。但登录框似乎会阻止通话。

I am using Selenium in C# on Windows 10. The site under test should challenge with a Windows Security login box in IE, which it does. But the login box appears to block the call.

var home = "https://site.under.test.com/"; 
driver = new InternetExplorerDriver(AppDomain.CurrentDomain.BaseDirectory);

driver.Url = home;
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl(home + "secure/");

//code to handle login box goes here, never gets executed unless the dialog box 
//is manually addressed or something times out in GoToURL(), 
//and then the dialog box doesn't work.

出现登录框:
点击此处查看登录框的屏幕

但是执行停止了GoToUrl()致电:
点击此处查看执行情况

But the execution is stalled on the GoToUrl() call: Click here for screenie of execution

无论我在此之后放置什么代码来处理弹出窗口,执行都会被阻止,直到GoToUrl()内部超时。

Doesn't matter what code I place after this to handle the popup, execution is blocked until something times out inside GoToUrl().

这是预期的行为吗?如何绕过它?

Is this expected behavior? How does one get around it?

澄清:问题不在于如何在弹出窗口中输入数据。这是关于代码执行没有达到我可以在没有干预或超时的情况下将数据输入弹出窗口的程度。

Clarification: The problem is not how to enter data into the popup. It is about the code execution not advancing to the point where I can enter data into the popup without intervention or timeout.

这适用于Win8.1,但不适用于Win10

This works on Win8.1, but not on Win10

推荐答案

Webdriver no更长时间正式支持基本认证它已从Java代码中删除,.Net版本意外地工作。根据我的经验,你可以期望它在Win7-8.1上工作(现在),但不能在Win10上工作

The Webdriver no longer officially supports Basic Authentication. It has been removed from the Java code and the .Net version works accidentally. From my experience you can expect it to work (for now) on Win7-8.1, but not on Win10

这来自Selenium支持:
认证的支持使用此提交从java绑定中删除了对话框。

This from Selenium support: The support of authentication dialogs was removed from the java bindings with this commit.

我很惊讶,它们仍然存在于c#绑定中,因为 webdriver规范

I am surprised, they are still present in the c# binding, because there is no support for basic authentication in the webdriver specification.

这篇关于IE Windows安全性对话框似乎阻止Selenium导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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