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

查看:40
本文介绍了最小化 RDP(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 自动化/测试工具通常在他们的常见问题解答中都有一个注释来描述这种问题.例如 QF-Test 的 FAQ 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_USERSoftwareMicrosoftTerminal 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天全站免登陆