使用Teamcity进行编码的UI测试

问题描述 投票:8回答:1

我运行MSTest来使用Teamcity在VM上测试WPF应用程序(Coded UI Test)。我已经将测试代理安装为交互式进程,但我在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的方法吗?

wpf testing teamcity coded-ui-tests teamcity-8.0
1个回答
7
投票

编码UI测试(CUIT)无法从服务帐户运行,因为他们需要访问Desktop Windowing API集。

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

© www.soinside.com 2019 - 2024. All rights reserved.