QTP is Not able to Click on OK button of Window popup when the VM is minimised

时光总嘲笑我的痴心妄想 提交于 2019-12-07 09:30:18

问题


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.

below is the code

  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

Virtual mechine OS Is -- Microsoft Windows XP Professional

Can any one help me on this.


回答1:


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.

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)

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.



来源:https://stackoverflow.com/questions/22814903/qtp-is-not-able-to-click-on-ok-button-of-window-popup-when-the-vm-is-minimised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!