Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium test fails on build server with "No response from server" error

I have a simple Selenium test within VS2010 test project as follows.

[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();  
    }  
}  

This runs fine on the local server. However on the build server it fails with the following message. ...threw exception: OpenQA.Selenium.WebDriverException: No response from server for url http://localhost:4444/session/5e5e9b7a-e05c-40d8-9a20-9cab138b2b87.

The problem seems to be calling the Quit() method in the finally clause. I tried to pass in a known port number, i.e. InternetExplorerDriver(8080), but it made no difference. Firefox driver runs fine both locally and on the build server. I found someone reporting similar issue but did not find a working solution. http://groups.google.com/group/webdriver/msg/4347971da4d96e97

Here is my config. Windows 7 professional SP1, 64 bit.
Webdriver - selenium-dotnet-2.0b2.
IE8.

My build server is Windows Server2008 R2 Standard with IE8.
Thanks.

like image 766
Redzon Avatar asked Feb 24 '23 20:02

Redzon


1 Answers

The Internet Explorer driver requires some configuration of IE as documented in the project wiki. You will need to make sure that the browser is configured properly on your build server.

The Selenium project has been updated recently to throw a more useful error in the case where the IE driver isn't configured properly. Updating to 2.0rc2 will give you this more useful error.

like image 81
JimEvans Avatar answered Feb 27 '23 10:02

JimEvans