最小化VM时,QTP无法单击窗口弹出窗口的“确定"按钮 [英] QTP is Not able to Click on OK button of Window popup when the VM is minimised

查看:132
本文介绍了最小化VM时,QTP无法单击窗口弹出窗口的“确定"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从虚拟机执行QTP脚本.最小化VM时,QTP无法单击窗口弹出窗口的确定"按钮.

I am executing the QTP scripts from Virtual mechine. QTP is not able to click on OK button of Window pop-up when VM is minimised.

下面是代码

  If Browser("name:=.*").Dialog("text:=Message from webpage","nativeclass:=#32770").Exist(50) Then
   Browser("name:=.*").Dialog("text:=Message from webpage","nativeclass:=#32770").Activate
   Browser("name:=.*").Dialog("text:=Message from webpage","nativeclass:=#32770").WinButton("text:=OK").Click
  End If

虚拟机操作系统是-Microsoft Windows XP Professional

Virtual mechine OS Is -- Microsoft Windows XP Professional

有人可以帮我吗?

推荐答案

您看到的行为并非特定于虚拟机.即使您通过RDP连接到物理机,并且窗口已最小化,QTP也将无法运行特定步骤.原因是由于RDP与Windows之间的紧密集成,当最小化客户端窗口时,它会通知Windows没有活动的显示,并且Windows不会关注鼠标和键盘事件.

The behaviour you're seeing isn't specific to virtual machines. Even if you're connected to a physical machine via RDP and the window is minimized QTP will fail to run specific steps. The reason for this is due to the tight integration between RDP and Windows, when the client window is minimized it informs Windows that there is no active display and Windows doesn't pay attention to mouse and keyboard events.

从UFT 11.53开始UFT支持

Starting with UFT 11.53 UFT supports running on disconnected RDP sessions. You can activate this feature from Tools → Options → General → Run Sessions (See screen shot)

如果您使用的是较旧版本的QTP,则此问题的解决方法是使用与Windows集成程度较低的其他远程桌面程序(例如

If you're using an older version of QTP then a workaround to this problem is to use a different remote desktop program which is less well integrated into Windows (e.g. RealVNC). Thus Windows will keep responding to QTP's simulated mouse and keyboard events even if the client's window is minimized.

这篇关于最小化VM时,QTP无法单击窗口弹出窗口的“确定"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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