Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coded UI test fails with MSTest under Jenkins

I am using Jenkins for my project CI. And several automation test cases developed by Coded UI(C# language) will be run when the new build is deployed. I created a job on the master(windows) that MSTest those test cases(note: with MSTest under cmd, test cases can be run successfully) but saw the below issue:

Error calling Initialization method for test class QuickUI.SmokeTests: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. For more information, see "How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop" (http://go.microsoft.com/fwlink/?LinkId=159018)

Therefore,
1) Need I use Jenkins slave to run test cases?
2) If so, how to config since the dlls needs to be copied to slave firstly?
3) Is there any account or jenkins service configuration needs to be taken care?

Thanks in advance.

like image 925
Gary Wang Avatar asked Oct 21 '22 18:10

Gary Wang


1 Answers

Sounds like you need to get mstest setup on your build machine. The easiest way is to use test agents (http://www.microsoft.com/en-us/download/details.aspx?id=38186) when installing chose test agents.

(below is copied from my answer in Coded UI build server integration process)

  1. You going to want to put your CodedUI tests inside an orderedTest. Right Click on the solution -> add -> orderedTest.
  2. You going to want to install https://wiki.jenkins-ci.org/display/JENKINS/MSTestRunner+Plugin it's not a requirement, but it makes working with mstest in jenkins a little easier.
  3. At this point you just need to configure the plugin in jenkins to run your orderedTest. It will need you to point to mstest and the location of your orderedtest.
like image 191
Zaq Wiedmann Avatar answered Oct 27 '22 09:10

Zaq Wiedmann