编码的UI测试失败并出现错误 - 自动化引擎无法回放测试,因为它无法与桌面交互 [英] Coded UI Tests fails with error - Automation engine is unable to playback the test because it is not able to interact with the desktop

查看:55
本文介绍了编码的UI测试失败并出现错误 - 自动化引擎无法回放测试,因为它无法与桌面交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Windows任务调度程序自动执行编码的ui测试。这就是我正在做的事情 -  

I am trying to automate coded ui tests using windows task scheduler. Here is what I am doing - 

我在我的Windows 10主机上启用了hyper-V并创建了另一个Windows 10 hyper-V VM。我使用hyper-V管理器连接到VM。我在VM上安装了可视化工作室,我有我的编码ui测试解决方案。我在VM上创建了一个测试控制器,并且在同一个VM上创建了一个测试代理
,我将测试代理配置为作为交互式进程运行。我创建了一个设置文件,我将连接到控制器,该控制器将测试发送给测试代理。我创建了一个批处理文件,我在其中调用
这样的测试 -

I enabled hyper-V on my windows 10 host and created another windows 10 hyper-V VM. I connect to the VM using hyper-V manager. I have visual studios installed on the VM where I have my coded ui test solution. I created a test controller on the VM and also a test agent on the same VM and I configured the test agent to run as an interactive process. I created a settings file where I am connecting to the controller which sends the tests to the test agent. I created a batch file where I am calling the tests like this -

设置mstestPath =" C:\Program Files(x86)\ Microsoft Visual Studio 12.0 \\ commmon7 \IDE"
$
set resultPath =" TestResults"

%mstestpath%\ mstest /testcontainer:bin\Debug\E2EProductTest.dll / category: "试验" /testsettings:CodedUI.testsettings

set mstestPath="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE"
set resultPath="TestResults"
%mstestpath%\mstest /testcontainer:bin\Debug\E2EProductTest.dll /category:"test" /testsettings:CodedUI.testsettings

然后我使用Windows调度程序调度任务以频繁运行批处理文件。 

Then I sceduled a task using windows scheduler to run the batch file in frequent intervals. 

当我运行时直接或通过调度程序批处理文件并打开hyper-V VM窗口,一切正常。我甚至可以在测试代理中运行的测试中看到。在我最小化Hyper-V VM窗口的那一刻,测试失败并出现错误 - "Automation
引擎无法回放测试,因为它无法与桌面交互"。 

When I run the batch file directly or through the scheduler and have the hyper-V VM window open, everything works fine. I can even see in the tests running in the test agent. The moment I minimize the hyper-V VM window, the tests fail with error - "Automation engine is unable to playback the test because it is not able to interact with the desktop". 

我确实阅读了很多关于此的内容并使用了Hyper-V解决方案,因为RDP在最小化时不会保持桌面活动,但显然hyper-V就是这样。虽然在我的情况下,这不是正在发生的事情。 

I did read a lot about this and went with the hyper-V solution since RDP will not keep the desktop active when minimized but apparently hyper-V does that. Although in my case, that is not what is happening. 

我的测试做的是打开outlook,编写和发送电子邮件,然后打开浏览器进行一些验证。 

What my tests do is opens up outlook, composes and sends an email and then opens up a browser to to do some validations. 

我在这里遗漏了什么吗?

Am I missing something here?

推荐答案

查看
this
帮助。


这篇关于编码的UI测试失败并出现错误 - 自动化引擎无法回放测试,因为它无法与桌面交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆