SOFTWARE TESTING: How to Close QTP after execution

Tuesday, October 11, 2011

How to Close QTP after execution

How to Close QTP after execution



How to Close QTP after execution 
Private Function CloseQTP        
    Set objWMIService = GetObject(“winmgmts:\\.\root\CIMV2″)     
       Set colProcess = objWMIService.ExecQuery (“Select * from Win32_Process Where Name = ‘QTPro.exe’”)     
       For Each objProcess in colProcess                      
  objProcess.Terminate()           
 Next          
  Set objWMIService = Nothing         
   Set colProcess = NothingEnd FunctionCall CloseQTP

1 comment:

  1. Hi,
    How can i remove associated .vbs file from the test (during execution) to improve performance.
    Thanks
    Dinesh.s
    Test Automation

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...