title: WebDriver test using Google Chrome hangs when executed via build process using TFS/NUnit
body: <p>I'm having an issue with Selenium WebDriver, Microsoft Team Foundation Server, NUnit and Chrome/ChromeDriver.  I'm hoping that maybe someone can offer some insights or point me in a direction to investigate.  Right now I'm stymied on this issue.</p>
  
  <p>The details of the problem -</p>
  
  <p>I have discovered that my selenium test automation is hanging when the tests are called by our automated build process (Microsoft Team Foundation Server) using Google Chrome as the Test browser.  Essentially TFS builds via MSBuild and then calls NUnit, which in turn executes my Selenium tests.   I can see in Windows Task Manager (and in the build logs) that the nunit-console, nunit-agent, Google Chrome and ChromeDriver processes are launched but then the processes appear to just hang.</p>
  
  <p>Again, this only repros when the test is automatically kicked off on our build machine using Google Chrome as the browser to test against.  I verified that the account running TFS is an admin and this issue doesn't manifest itself when I use Firefox as the browser for our automation run/build process.  </p>
  
  <p>I wrote a bunch of debugging statements in the code and managed narrow down the hang to lines such as this:</p>
  
  <pre><code>IWebElement element =driver.FindElement(By.XPath(strXpath));
  </code></pre>
  
  <p>The strXpath value for the above statement is this:</p>
  
  <pre><code>//ul[contains(@class,'topnew')]
  </code></pre>
  
  <p>I have tried changing the By selector to search for an element with a css class or Id such as this but I still see the issue:</p>
  
  <pre><code>element = driver.FindElement(By.ClassName("topnew"));
  </code></pre>
  
  <p>Here is the very last few statements in the ChromeDriver log:</p>
  
  <pre><code>[157.979][FINER]:   Waiting for all views to stop loading...
  [216.963][FINE]:    Command received (/session/43fb268cae9e2131577d6fdddedb5c7f/refresh
  [216.963][FINER]:   Waiting for all views to stop loading..
  </code></pre>
  
  <p>Here is the Software running on our build machine-</p>
  
  <pre><code>Selenium version 2.18.0.0 (I have also tried 2.14.0.0) using the .Net binaries (the tests are written in C#)
  Nunit version 2.5.9.10348
  Windows Server 2008 R2
  Chrome version 16.0.912.77
  ChromeDriver.exe version 18.0.995.0 (windows version)
  Microsoft Team Foundation Server 2010 – version 10.0.30319 
  </code></pre>
  
  <p>As a workaround I tried  getting MSBuild to call a powershell script that then calls NUnit but the issue still persists.</p>