Stop Qtp (Quick Test Professional) at the End of the Testcase
Quick Test Professional (Test Automation)
Below Code will help you to Start/Stop QTP
'*****************************
Dim App
StartQTP
StopQTP
' Start QTP
Function StartQTP ()
' Launch QuickTest Professional and make it visible.
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
End Function
' Stop QTP
Function StopQTP ()
App.Quit
End Function
'*****************************
Make a Note that, You can be able to Close QTP using VB Script if you have started QTP using the same Script so you can use the same Object to Close it.
If you are starting QTP outside of any other Script then you have to Kill QTP Process.
To KILL QTP Process, you can use below CODE.
'*****************************
Call KillProcessByName("QTPro")
' Kill Process By Name
Public SubKillProcessByName (ByVal psProcessName As String)
'* Iterate through all running processes to locate the specified process and kill it.
For Each pProcess As Process In Process.GetProcessesByName(psProcessName)
'* Kill the process
If Not pProcess.HasExited Then Call pProcess.Kill()
'* Wait while the process completes it's exit.
Do While Not pProcess.HasExited
Call System.Windows.Forms.Application.DoEvents()
Loop
Next 'pProcess
End Sub
'*****************************
Enjoy Automated Testing!!
Published by Paresh
I love to do Painting, Sketching, Photography and many more things. I started writing on things which interests me. I am not an expert in writing but I am trying to be a good writer :) Most of the time yo... View profile
- How to Solve Page Loading or a Synchronization Problem During Automated Testing
- Successful Software Testing Automation
- Automating UI Through QTP
- Facts About Automated Testing
- Facts About Functional Testing
- Maintainable Software
- 5 Minute Guide to Selenium IDE and Selenium Remote Control (Java) Test Tools
|
|
- Different ways of stopping QTP at the end of the Test
- Test Automation
1 Comments
Post a CommentGood job..