3

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.

The details of the problem -

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.

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.

I wrote a bunch of debugging statements in the code and managed narrow down the hang to lines such as this:

IWebElement element =driver.FindElement(By.XPath(strXpath));

The strXpath value for the above statement is this:

//ul[contains(@class,'topnew')]

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:

element = driver.FindElement(By.ClassName("topnew"));

Here is the very last few statements in the ChromeDriver log:

[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..

Here is the Software running on our build machine-

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 

As a workaround I tried getting MSBuild to call a powershell script that then calls NUnit but the issue still persists.

Scott M.
  • 31
  • 2

1 Answers1

2

This is a known bug. I ended up wrapping the call using a gevent timeout, so if chromedriver locks up, I can simply kill it and restart it.

David Lemphers
  • 3,568
  • 3
  • 18
  • 10