automated-tests - 通过 Octopus Tentacle 编码的 UI 自动化测试用例

标签 automated-tests coded-ui-tests vstest.console.exe vstest.console

我正在尝试运行部署在虚拟机上的自动化测试用例,并尝试在 Octopus 部署工具的帮助下触发它。我在我的机器上安装了测试代理和八达通触手。 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"

我尝试了我找到的每一种方法。请帮我解决这个问题。

提前致谢!!

最佳答案

我们最近遇到了同样的问题。

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

虽然我们对“用于测试运行的计划任务”方法不走运,但我们最终通过将 Octopus Tentacle 作为一个进程而不是一个服务来运行来使其工作。

这里的挑战是确保 Tentacle 在我们的测试机器启动时启动。我们希望这能自动发生,所以每次 RDP 进入和启动过程是不可能的(这也给 UI 测试运行带来了一些额外的问题......)。

最后一个可行的解决方案是安排一个任务,该任务将在机器启动时作为交互过程启动 Octopus Tentacle(即直接运行 Tentacle.exe),然后确保我们永远不会对这台机器进行 RDP。确保任务具有足够的权限,并且它“无论用户是否登录都运行”。此外,请记得关闭八达通触手服务的自动启动功能。

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

我们再次搜索可能的解决方案,并遇到了 FireDaemon Pro (commercial software) ,它允许我们注册在域用户下运行的交互式 Windows 服务。不太确定它是如何工作的,但它们似乎能够从 session0 中的 Windows 服务运行 UI(UI 也是隔离的)。 Octopus Tentacle 开始时毫无怨言,UI 测试按照我们希望的方式运行。

关于automated-tests - 通过 Octopus Tentacle 编码的 UI 自动化测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40124980/

相关文章:

unit-testing - 最喜欢的.NET单元测试框架

ios - Frank 自动化框架是否为故障场景提供屏幕截图捕获选项?

tfs - 如何从代码中禁用CodedUI测试代理?

tfs - 为什么 TFS 代理未发现 VSTEST 功能

c# - vstest.console.exe 可以在没有安全证书的情况下运行 appx

node.js - 如何让 Nightwatch.js 在 Internet Explorer 上运行测试

ios - 区分 Calabash iOS 中的 ScrollView

wpf - 使用 Teamcity 进行编码的 UI 测试

wpf - 带有自动化/编码 UI 测试的第三方 WPF 套件

c# - 使用 Microsoft.Data.SqlClient 2.0 时无法从单元测试加载 DLL 'Microsoft.Data.SqlClient.SNI.x86.dll'