4

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.

Amit
  • 19,780
  • 6
  • 46
  • 54
user3489895
  • 41
  • 1
  • 3

1 Answers1

5

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)

UFT options pane

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.

Motti
  • 110,860
  • 49
  • 189
  • 262