Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
Absent Member.. vzamoraz Absent Member..
Absent Member..
383 views

QTP/UFT support tip: How to close a processes from QTP/UFT

If you need to close some processes on your machine or you need to be sure that some processes don't have to be running when test is going to be executed then you can use the SystemUtil method to close them.

 

SystemUtil provides you different options to close a process: by name, by window title, by handle, by id.

 

Example:

SystemUtil.CloseProcessByName "iexplore.exe"
SystemUtil.CloseProcessById "2222"

systemutil.CloseProcessByWndTitle "Untitled - Notepad"

 

Also CloseProcessByWndTitle allows you to use regular expression so for example if you want to close all processes which window title start with Application (Application - main, Application - Sub, Application - Logs, etc.)

You can use regular expression to close all of them

 

SystemUtil .CloseProcessByWndTitle "Application.*",True 

 

The second parameter indicates that the string is a regular expression.

 

 

HP support
If you find that this or any post resolves your issue, mark it as an accepted solution.

 

Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

 

Labels (1)
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.