Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Killing the windows process using QTP Script.
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
I am creating word object and excel object in my script. After execution of script, windows process (winword.exe) will be showing in Task Manager.
After multiple execution of test cases, it keep on creating WINWORD.exe in task manager. After some time, script will not work.
After execution of every script, I can kill the process.

How to kill this Windows process (WINWORD.exe) using QTP script ?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
apply this method

wdobject.Quit
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

You can use killExcel() to kill the excel process before opening or after editing.


Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Very easy: SystemUtil.CloseProcessByName("WINWORD.exe")

* You may want to save your file before killing the process... good luck.

Rodrigo
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

You can use the below function. This will kill any process runing in task manager. All u need to do is to pass the Program name.
Code:
Public Function General_CloseProcess(strProgramName)
   Dim objshell
   Set objshell=CreateObject("WScript.Shell")
   objshell.Run "TASKKILL /F /IM "& strProgramName
   Set objshell=nothing
End Function

'If want to close excel
Call General_CloseProcess("Excel.EXE")
'Killing word
Call General_CloseProcess("WINWORD.exe")

Regards,
Ankesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Control to spawned process DomG 1 1,165 07-03-2020, 07:21 PM
Last Post: Ankur
  Windows 8 envirnment error while running QTP script. Rashmi Rajpal 0 2,444 10-10-2013, 12:21 PM
Last Post: Rashmi Rajpal
  Running QTP script via Cron/Windows Scheduler/ ksnalni 3 5,231 05-08-2012, 10:19 AM
Last Post: sshukla12
  QTP Business Process Testing vijaya2009 1 4,860 01-11-2012, 11:38 AM
Last Post: nileshpatil70
Smile Need Some Info - on Automation process Nageshearaiah 0 2,269 06-11-2011, 06:10 PM
Last Post: Nageshearaiah

Forum Jump:


Users browsing this thread: 1 Guest(s)