远程最小化机器 VBS 中的 Sendkeys [英] Sendkeys in remote minimized machine VBS

查看:49
本文介绍了远程最小化机器 VBS 中的 Sendkeys的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SAP 应用程序的对象中执行 Shift + Enter 时遇到问题.

I´m having problems with doing Shift + Enter in an object of SAP application.

这是我的代码:

If Dialog("SAP Logon 730").WinListView("SysListView32").Exist(100) Then
    Dialog("SAP Logon 730").Activate
    Dialog("SAP Logon 730").WinListView("SysListView32").Select sServer
    Dialog("SAP Logon 730").Activate    
    SendKeysShell ("+{ENTER}") 
End if

服务器列表显示在对话框"对象中.必须选择一个(使用 .Select),然后使用 Shift + Enter 打开.

A list of server is displayed in the "Dialog" object. One must be selected (with the .Select) and then open using Shift + Enter.

问题是,如果我最小化远程机器,则 Sendkeys 无法正确执行.

The problem is that if I minimize the remote machine, the Sendkeys is not performed correctly.

推荐答案

如果您最小化远程桌面窗口(显示远程计算机桌面的窗口),Windows 会将远程会话切换到无 GUI 模式并且不会显示窗口和控件.这意味着您无法在会话最小化时与桌面交互,因此您的 UFT/QTP 脚本(无论如何对我来说都是这样)将失败.

If you minimise the Remote Desktop window (the window that displays the remote computer’s desktop), Windows switches the remote session to a GUI-less mode and doesn't display windows and controls. This means you can't interact with the desktop while the session is minimised and therefore your UFT/QTP script (that's what it looks like to me anyway) will fail.

作为一种可能的解决方法,您可以尝试以下步骤:

As a possible workaround, you can try the following steps:

  1. 在您的本地计算机上,关闭所有打开的远程桌面会话.
  2. 启动注册表编辑器 (regedit.exe).
  3. 导航到以下注册表项之一,具体取决于您是希望仅为当前用户还是计算机上的所有用户修改远程桌面设置:

  1. On your local computer, close all open Remote Desktop sessions.
  2. Launch the Registry editor (regedit.exe).
  3. Navigate to one of the following Registry keys, depending on whether you wish to modify the Remote Desktop settings only for the current user or for all users on the computer:

HKEY_CURRENT_USER\Software\Microsoft\终端服务器客户端

HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client

HKEY_LOCAL_MACHINE\Software\Microsoft\终端服务器客户端

HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client

创建一个名为 RemoteDesktop_SuppressWhenMinimized 的 DWORD 值并将其设置为 2.

Create a DWORD value named RemoteDesktop_SuppressWhenMinimized and set it to 2.

现在,当您最小化本地桌面上的远程会话时,远程计算机上的 GUI 可用性应该不受影响,并且您的测试用例应该继续正常运行.

Now, when you minimise the remote session on your local desktop, the GUI availability on the remote machine should be unaffected and your test case should continue to run OK.

希望有帮助...

这篇关于远程最小化机器 VBS 中的 Sendkeys的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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