2

I am attempting to run UI tests (using Windows Automation API) on a WPF application, on a CI basis. I have associated my solution with a .testsettings file and linked my test .dll to the build process. All seems to be well.

When I queue a new build, in TFS's build log I can see the command line arguments passed to MSTest (2010) on the build machine - it appears that the .testsettings file is loaded correctly and that the correct test .dll is passed to MSTest.exe.

However, it seems to be "stuck" after the Executing tests message - both when running through the build and by running it directly through the build machine. In addition, I have specified a startup script to run before the tests, in the .testsettings file (it copies the application's binaries locally so the test can start the application and run the applicable tests). This script doesn't seem to be executed (the directory to which the files are supposed to be copied is empty).

Has anyone seen a similar problem and knows how to deal with it?

Tal Bronfer
  • 759
  • 5
  • 18
  • What do you mean with "stuck"? I suppose "Executing tests" is the last output I see in build log and the build doesn't get completed, right? Hmm... could it be that your UI test is waiting for a user input (for credentials in order to access network/mapped network drive or something like that? If you need administrator rights for running your startup script what about UAC on the build machine? – Elena Aug 05 '13 at 07:27
  • 1
    Is this the only set of tests that hangs? I recently ran into a similar issue after installing VS 2012 on the build machine. Apparently, VS 2010 needed to have an update applied to be compatible with VS 2012. This is detailed [here](http://stackoverflow.com/questions/16337564/mstest-hangs-for-seemingly-no-reason). – Mike Zboray Aug 05 '13 at 16:20
  • Thank you so much! Would upvote if I could. I think that's it. This has been driving me crazy... I tried everything, from compiling the tests in .NET 4 and in VS 2010, to manually replacing DLLs on the build machine. I still haven't managed to install SP1 but I'm working on it. – Tal Bronfer Aug 06 '13 at 19:56

1 Answers1

4

As Mike said in the comments, the issue was actually a bug in VS 2010 that made it impossible to run tests through the 2010 IDE if you have VS 2012 installed side by side. Unfortunately, I was unable to install VS 2010 SP1 on the build machine, but it is also possible to solve the issue by adding the /noisolation argument to the standard command line syntax (this runs the tests through the MSTest process, which somehow solves the issue).

However, since you cannot define additional arguments to be passed to MSTest through TFS's integrated automated testing feature, I wrote my own application that invokes as a scheduled task, runs the tests and sends an email containing an HTML report (I used trx2html for that -- note that if you're using VS2012, you'll need the beta 0.7 version, as there's been a change in the .trx format since VS 2010).

Tal Bronfer
  • 759
  • 5
  • 18