Search code examples
vmwareschedulingqtpsiebel

QTP+VM: Why is the Click command not executed when I'm not conncted to the VM via Remote Desktop?


I'm using QTP 10 together with VMWare to test a Siebel Application. I'm executing the following code to click on a Save button.

Browser("Siebel").Dialog("Filedownload").WinButton("Save").Click

The code works perfectly fine when I'm connected to the VM via Remote Desktop.

On the other side, when I'm starting the QTP test through the scheduler, without having a Remote Desktop connection, the code above fails without any error message. The WinButton is simply not clicked.

Any idea?


Solution

  • Just to add from my experience.

    In some companies I worked for I couldn't change screensaver or standby settings due to security policy. A PC was bringing up screensaver during long synchronization periods (like generating really big report), and execution was broken.

    To avoid that I created simple "Anti Sleep" function that slightly "moves" mouse every 5 minutes. http://automation-beyond.com/2009/08/18/anti-sleep-function/

    Private Const SleepTime_Max = 300 ‘ 5 minutes
    Public Function AntiSleep()
    Dim iter
    Dim objTimer
    Dim objDeviceReplay
    Dim intTimeElapsed
    
     Set objTimer = MercuryTimers(“AntiSleep”)
     intTimeElapsed = CInt(objTimer.ElapsedTime/1000)
    
     If intTimeElapsed = 0 Then
      MercuryTimers(“AntiSleep”).Start
      Exit Function
     End If
    
     If intTimeElapsed < SleepTime_Max Then
      Exit Function
     End If
    
    Set objDeviceReplay = CreateObject(“Mercury.DeviceReplay”)
    
     For iter = 100 To 110
       objDeviceReplay.MouseMove iter,300
     Next
    
    MercuryTimers(“AntiSleep”).Start
    
    Set objDeviceReplay = Nothing
    
    End Function
    

    Example of using it in a custom synchronization function: http://automation-beyond.com/2009/08/20/gui-object-synchronization-custom-function/

    Thank you, Albert Gareev