且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

运行Powershell的Coded UI测试与运行TFS构建的Coded UI测试

更新时间:2023-11-22 20:43:58



嗨LEE KAH WAI,



欢迎来到MSDN论坛。



您能否分享一下这个失败测试的详细错误信息?在构建日志中将显示导致它的一些特定原因。



您似乎使用测试代理执行测试,对吧?由于您希望运行Coded UI测试,您必须配置测试代理以与桌面交互并构建以交互模式运行的
代理。
请查看:
https://docs.microsoft.com/en-us/visualstudio/test/how-to-set-up-your-test-agent-to-run-tests-that-interact-with- the-desktop?view = vs-2019#to-set-up-an-agent-to-run-as-a-process



您使用的是哪个版本的TFS?你能检查dll文件路径是否正确吗?



期待您的回复。



真诚


月跨度>


Hi,

  I've created a Coded UI test that runs on VS2017. It works if I launch VS2017 as an administrator.

ie. I'm able to launch and perform the mouse.click() operations. 

  I wanted to create nightly builds for these Coded UI tests. I've created a build in TFS which eventually launches the following command

"vstest.console.exe C:\agent\xxxxxxxx\test.dll"

The tests are executed but failed due to launch certain programs or failed the mouse.click() operations.

However, if I use Powershell as administrative mode and keyed in the same command. I'm able to run the test

Hi LEE KAH WAI,

Welcome to the MSDN forum.

Could you please share us the detail error info about this failed test? In the build log would be shown some specific reason that caused it.

It seems you use the test agent to execute the tests, right? Since you would like to run Coded UI test, you have to configure the test agent to interact with the Desktop and build agent running as interactive Mode. Please have a look with: https://docs.microsoft.com/en-us/visualstudio/test/how-to-set-up-your-test-agent-to-run-tests-that-interact-with-the-desktop?view=vs-2019#to-set-up-an-agent-to-run-as-a-process .

Which version TFS you used? Could you check if the dll file path is correct?

Looking forwards your reply.

Sincerely

May