最小化RDP(VM)时自动化脚本失败 [英] Automation Scripts Fail when RDP(VM) is minimized

查看:90
本文介绍了最小化RDP(VM)时自动化脚本失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直面临在其中一个VM上自动执行脚本的问题.我已经自动化了保存文档"的功能,理想情况下,该功能是Windows设计的UI.我尝试使用各种技术/工具,例如AutoIT,Python,Sikuli,但如果将VM最小化,脚本将停止.如果VM是通过RDP打开的,则可以正常运行,并且可以看到运行时执行.但是,如果我最小化RDP,脚本将在另存为"对话框中停止,所有发送键(Cntrl + s)或(Enter)都无法通过AutoIt脚本工作.请提供一些解决方案的帮助,以便即使在最小化模式下也能成功执行脚本.

I have been facing issue with automation execution of my script on one of the VM. I have automated the functionality of Saving a Document which is ideally a Windows Designed UI. I have tried using various technologies/tools like AutoIT, Python, Sikuli but the script halts if VM is minimized. It works perfectly fine is VM is open via RDP and I can see runtime execution. But If I minimize the RDP, the script halts at 'Save As' dialog box, none of the send keys (Cntrl+s) or (Enter) work via AutoIt script. Please help with some solution so as to have successfully execution of script even in minimized mode.

推荐答案

在最小化的RDP会话上执行脚本时,脚本失败的原因非常简单.GUI自动化/测试工具需要具有未锁定的活动桌面-否则操作系统会认为它不需要实际呈现GUI操作(这很耗时),因为没有用户可以看到呈现的图形用户界面.而且程序通常无法通过GUI进行通信...

The reason why your script fails when it gets executed over a minimized RDP session is quite simple. GUI automation/testing tools need to have an unlocked, active desktop - otherwise the operation system thinks that it doesn't need to actually render GUI operations (which is time consuming) since there no user can that can see the rendered graphical user interface anyway. And programs don't communicate via GUIs normally ...

这就是为什么QF-Test和其他GUI自动化/测试工具通常在其FAQ中有一条注释来描述这种问题.例如,对于QF测试,常见问题解答14,请参见 https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html

This is why QF-Test and other GUI automation/testing tools often have a note in their FAQs describing this kind of problem. For example FAQ 14 in the case of QF-Test, see https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html

如Windows 10或Windows Server 2016上的常见问题解答14中所述,如果存在RDP连接,则需要修改注册表.转到

As described in the FAQ 14 on Windows 10 or Windows Server 2016 and in case of an RDP connection you need to modify the Registry. Go to

HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client

并添加新值

RemoteDesktop_SuppressWhenMinimized as DWORD having the value 2

重新启动后,您将能够最小化RDP连接.但是,断开或关闭RDP连接可能仍会导致失败.

After restarting you will then be able to minimize the RDP connections. However disconnecing or closing the RDP connection will probably still result in a failure.

这篇关于最小化RDP(VM)时自动化脚本失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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