自动化测试 – 通过Octopus Tentacle编写的自动测试用例

我正在尝试运行部署在虚拟机上的自动化测试用例,并尝试在Octopus Deployment工具的帮助下触发它.我在我的机器上安装了测试代理和Octopus Tentacle. Octopus很好地触发了自动测试用例的DLL.但是当Octopus尝试运行测试用例时,它给出了一个错误如下: –

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)
Error    01:59:38
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)

我在测试代理中设置了密码并将其设置为吸引过程,但我仍面临同样的问题.

我通过Octopus触发我的DLL.

 & "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\MyWebaPP\Automated_test\Automated_test.dll"

我尝试了各种各样的方法.请帮助我.

提前致谢!!

最佳答案 我们最近遇到了同样的问题.

在我们的研究中,我们在Octopus支持论坛上发现了这篇文章:
http://help.octopusdeploy.com/discussions/questions/5080-tentacle-running-interactive-tests
我们还通过邮件联系了Octopus Deploy,他们基本上给了我们相同的回复.

虽然我们没有运行“计划运行测试任务”的方法,但我们最终设法通过将Octopus触手作为一个过程而不是一个服务来运行.

这里的挑战是确保在我们的测试机器启动时触手可以启动.我们希望这是自动发生的,因此每次RDPing和启动过程都是不可能的(这也导致了UI测试运行的一些额外问题……).

最终的工作解决方案是安排一个任务,在机器启动时(即直接运行Tentacle.exe)启动Octopus触手作为交互式进程,然后确保我们从不RDP到这台机器.确保该任务具有足够的权限,并且“运行用户是否登录”.另外,请记住禁用Octopus Tentacle Service的自动启动.

编辑:我们在使这个解决方案适用于所有环境时遇到了一些麻烦.似乎出于安全原因,较新版本的Windows对于在没有用户登录时允许计划任务启动交互式进程持怀疑态度.

我们对可能的解决方案进行了另一次搜索,并遇到了FireDaemon Pro (commercial software),它允许我们注册在域用户下运行的交互式Windows服务.不太确定它是如何工作的,但它们似乎能够在session0中从Windows服务运行UI(UI也是隔离的). Octopus触手开始没有抱怨,UI测试以我们想要的方式运行.

点赞