title: Selenium error: No response from server for url http://localhost:7055
body: <p>I'm using Selenium, C#, NUnit to write tests, sometimes I getting below error:-</p>
  <blockquote>
  <p>OpenQA.Selenium.WebDriverException : No response from server for url
  httр://lоcalhost:7055/hub/session/8dd13f5c-7ca6-4aa6-babc-f0ff6d940f0a/element</p>
  </blockquote>
  <p>Here is stack trace:</p>
  <blockquote>
  <p>OpenQA.Selenium.WebDriverException : No response from server for url
  httр://localhost:7055/hub/session/8dd13f5c-7ca6-4aa6-babc-f0ff6d940f0a/element
  at
  OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest
  request) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\HttpCommandExecutor.cs:line
  115 at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command
  commandToExecute) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\HttpCommandExecutor.cs:line
  96 at
  OpenQA.Selenium.Firefox.Internal.ExtensionConnection.Execute(Command
  commandToExecute) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Firefox\Internal\ExtensionConnection.cs:line
  128 at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String
  driverCommandToExecute, Dictionary`2 parameters) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
  795 at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String
  mechanism, String value) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
  836 at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementById(String
  id) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
  431 at OpenQA.Selenium.By.&lt;&gt;c__DisplayClass2.b__0(ISearchContext
  context) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\By.cs:line 102 at
  OpenQA.Selenium.By.FindElement(ISearchContext context) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\By.cs:line 272 at
  OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by) in
  c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
  289 at</p>
  .####.##.#####.#########.#####.ShareServicesTest.CreateShareWidget()
  </blockquote>
  <p>Code where this error appears:</p>
  <pre><code>Driver.SwitchTo().Frame(frameElement);    
  var wait = new WebDriverWait(parentContextable.Context.Driver, Timeout);
  IWebElement element = wait.Until(d =&gt; Driver.FindElement(By.TagName(Tags.Body))); // error in this line
  </code></pre>
  <p>I figured out that this error can be thrown only in this lines of Selenium implementation code:</p>
  <pre><code>private static Response CreateResponse(WebRequest request)
          {
              Response commandResponse = new Response();
  
              HttpWebResponse webResponse = null;
              try
              {
                  webResponse = (HttpWebResponse)request.GetResponse();
              }
              catch (WebException ex)
              {
                  webResponse = (HttpWebResponse)ex.Response;
              }
  
              if (webResponse == null)
              {
                  throw new WebDriverException(&quot;No response from server for url &quot; + request.RequestUri.AbsoluteUri);
              }
              else
              { ...
  </code></pre>
  <p>Maybe someone knows why request.GetResponse() returns null, or if it fails why ex.Response also null?</p>
  <p>(09.09.2012) Sorry but maybe I didn't provide all information. I'm using FireFox driver, Win7, Selenium 2.25.1. My test fails only sometimes. Test in debug mode fails less often then in Release.</p>
  <p><a href="https://groups.google.com/forum/#!msg/selenium-users/W7bYZIgOREA/tWzCCutVS8QJ" rel="noreferrer">Here</a> I found possible reasons why this happen. And if I write such code:</p>
  <pre><code>Driver.SwitchTo().Frame(frameElement);    
  var wait = new WebDriverWait(parentContextable.Context.Driver, Timeout);
  Tread.Sleep(250);
  IWebElement element = wait.Until(d =&gt; Driver.FindElement(By.TagName(Tags.Body)));
  </code></pre>
  <p>Test runs OK. But Thread.Sleep is bad solution. Maybe somebody could find another, little bit better solution.</p>