C# 使用Selenium 2.7.0创建新InternetExplorerDriver时的SocketException

C# 使用Selenium 2.7.0创建新InternetExplorerDriver时的SocketException,c#,webdriver,selenium-webdriver,socketexception,C#,Webdriver,Selenium Webdriver,Socketexception,我正在尝试创建Selenium InternetExplorerDriver的新实例以运行一个简单的测试,并收到以下异常消息: SocketException occurred No connection could be made because the target machine actively refused it ::1:56335 在这一点上,它到底想连接到什么?我已尝试使用以下代码设置驱动程序的代理设置,但仍然收到相同的错误: var proxy = new Proxy { P

我正在尝试创建Selenium InternetExplorerDriver的新实例以运行一个简单的测试,并收到以下异常消息:

SocketException occurred
No connection could be made because the target machine actively refused it ::1:56335
在这一点上,它到底想连接到什么?我已尝试使用以下代码设置驱动程序的代理设置,但仍然收到相同的错误:

var proxy = new Proxy { ProxyAutoConfigUrl = "http://myworkproxy.removed.com:1234" };
var capabilities = DesiredCapabilities.InternetExplorer();
capabilities.SetCapability(CapabilityType.Proxy, proxy);
driver = new InternetExplorerDriver(capabilities);

我已经搜索过了,但是找不到关于Selenium最新版本的很多文档。有什么建议吗?

如果您使用的是最新版本的Selenium(Selenium webdriver),则会出现
SocketException
,因为您的代码无法通过默认端口(我相信是4444)连接到Selenium服务器。这可能是因为您尚未启动selenium服务器(作为jar文件提供-请参阅selenium主页),或者可能有另一个应用程序正在使用您尝试连接的同一端口