Micro Focus QTP (UFT) Forums
How to close/restart UFT in "Not responding" status with AOM script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to close/restart UFT in "Not responding" status with AOM script (/Thread-How-to-close-restart-UFT-in-Not-responding-status-with-AOM-script)



How to close/restart UFT in "Not responding" status with AOM script - CharlieMadrid - 05-21-2020

Hi,

I use a UFT project several times for performance test, and I use this AOM script to execute the test 100 iterations, to reduce the UFT load memory, the script will stop and run again UFT each 10 iterations. But in some case , UFT is in "Not Responding" status( Launched but not responding) during the test, and it fails. How can I resolve this issue?

The AOM script is:

Dim qtApp,qtTest, i 
'Create a QuickTest Professional AOM object
Set qtApp = CreateObject("QuickTest.Application")
If Not qtApp.Launched then
StartUFT()
end if

set qtTest = qtApp.Test ' Get access to the test
' Get the current value of the "it_start" environment variable. This is the iteration start index.
itstart = qtTest.Environment.Value("it_start")
' Get the current value of the "it_stop" environment variable. This is the iteration stop index.
itstop = qtTest.Environment.Value("it_stop")
For i = CInt(itstart) To CInt(itstop)

If i Mod 10 = 0 Then
CloseUFT()
End If
If Not qtApp.Launched then
StartUFT()
set qtTest = qtApp.Test
end if
qtTest.Run
Next
CloseUFT()
Set qtTest = Nothing
Set qtApp = Nothing

Function StartUFT()
    qtApp.Launch
qtApp.Visible = True
qtApp.Open "<Path>" 'name of the start up script
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
 End Function
 
 Function CloseUFT()
qtTest.Close
qtApp.quit
 End Function