Gary Wang
Gary Wang

Reputation: 91

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.

Upvotes: 5

Views: 4442

Answers (2)

Zaq Wiedmann
Zaq Wiedmann

Reputation: 333

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.

Upvotes: 2

Andy Chen
Andy Chen

Reputation: 361

1) Recommnd to run test on slave 2) To run GUI test, don't run the slave as windows service 3) Theoratically you only need the slave agent running. However the windows account logged in should have access to all the resources that your tests need.

Some other threads you could reference, pay special attention to this if you want to run the tests in unattended way.

Jenkins on Windows and GUI Tests without RDC

Upvotes: 1

Related Questions