我在VS2010测试项目中有一个简单的Selenium测试,如下所示。Selenium测试在“服务器没有响应”错误的构建服务器上失败
[TestMethod]
public void MyTestInIE8()
{
IWebDriver driver = new InternetExplorerDriver();
try
{
driver.Navigate().GoToUrl("http://localhost/MyMVC/ABC/DoStuff");
driver.FindElement((By.Id("Name"))).SendKeys("John");
//... run rest of the test
}
finally
{
driver.Quit();
}
}
这在本地服务器上运行良好。但是,在构建服务器上,它会失败并显示以下消息。 ...抛出异常:OpenQA.Selenium.WebDriverException:服务器对url http://localhost:4444/session/5e5e9b7a-e05c-40d8-9a20-9cab138b2b87没有响应。
问题似乎是在finally子句中调用Quit()方法。我尝试传入一个已知的端口号,即InternetExplorerDriver(8080),但它没有任何区别。 Firefox驱动程序可以在本地和构建服务器上正常运行。我发现有人报告类似的问题,但没有找到工作解决方案。 http://groups.google.com/group/webdriver/msg/4347971da4d96e97
这是我的配置。 Windows 7 professional SP1,64位。
Webdriver - selenium-dotnet-2.0b2。
IE8。
我的构建服务器是带有IE8的Windows Server2008 R2 Standard。
谢谢。
问题是否解决。即使我在同一个环境中也面临同样的问题。 – Chidambaram 2011-05-02 11:02:56