title: Selenium WaitForCondition fails after 30 minutes instead of 20 seconds
body: <p>In our functional tests we use <code>ISelenium.WaitForCondition</code> method to test whether AJAX calls are finished using something like this:</p>
  
  <pre><code>_selenium.WaitForCondition("!selenium.isElementPresent(\"" + locator + "\")", "20000");
  </code></pre>
  
  <p>Sometimes this code fails with SeleniumException:</p>
  
  <pre><code>Selenium.SeleniumException: ERROR: Command timed out
  </code></pre>
  
  <p>But instead 20000 ms it takes 30 minutes to fail and after that all subsequent selenium calls fail with something like:</p>
  
  <pre><code>SeleniumException : ERROR Server Exception: unexpected command
  json={command:"waitForCondition",target:"!selenium.isElementPresent(\"//div[contains(@id, \'atlProgress\') and contains(@style, \'display: block\')]\")",value:"20000"}
  in place before new command waitForCondition could be added
  </code></pre>
  
  <p>We use .NET Selenium port: ThoughtWorks.Selenium.Core, Version=2.7.0.0 and not a WebDriver.</p>
  
  <p>What could we do to avoid these errors?</p>