9

我运行 MSTest 以使用 Teamcity 在 VM 上测试 WPF 应用程序(编码 UI 测试)。我已经将测试代理安装为交互式进程,但我在 Teamcity 日志中不断收到此错误

Error calling Initialization method for test class Squarebit.Apms.Terminal.Wpf.Test.CodedUITest1: 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=255012)
If you are running the tests as part of your team build, you must also set up the build agent to run as an interactive process. For more information, see "How to: Configure and Run Scheduled Tests After Building Your Application" (http://go.microsoft.com/fwlink/?LinkId=254735)
   at Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize()
   at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestExtensionExecution.BeforeTestInitialize(Object sender, BeforeTestInitializeEventArgs e)
   at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecution.RaiseBeforeTestInitialize(BeforeTestInitializeEventArgs args)
   at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.RunInitializeMethod()

你能帮我解决这个问题或推荐一些使用 Teamcity 运行 Coded UI Test 的方法吗?

4

1 回答 1

7

编码的 UI 测试 (CUIT) 无法从服务帐户运行,因为它们需要访问桌面窗口 API 集。

请参阅http://jake.ginnivan.net/teamcity-ui-test-agent/Installing the teamcity build agent中的部分将 teamcity 代理设置为非服务帐户。

于 2014-07-24T13:23:18.860 回答