0
votes

I am trying to kill java process running on a remote PC using PSKill.exe, which is working fine through a batch file. However, it is not working while running through OS process sampler. Attached screenshot of OS sampler.

I am getting below error message, appreciate if you can help me with a solution


Thread Name: Thread Group 1-1 Sample Start: 2017-06-14 14:25:31 BST Load time: 16 Connect Time: 0 Latency: 0 Size in bytes: 0 Sent bytes:0 Headers size in bytes: 0 Body size in bytes: 0 Sample Count: 1 Error Count: 1 Data type ("text"|"bin"|""): text Response code: 500 Response message: Exception occurred whilst executing system call: java.io.IOException: Cannot run program "PsKill.exe" (in directory "c:\Support"): CreateProcess error=2, The system cannot find the file specified

Response headers:

SampleResult fields: ContentType:

DataEncoding: null

Regards, Ram JMeter - OS Sampler Image

1

1 Answers

0
votes

You need to change it a little bit, i.e. provide full path to the PsKill executable via "Command" input, like:

JMeter OS Process Sampler Full Path

As "Working directory" is a different beast, you need to explicitly "tell" JMeter where PsKill.exe lives.

You might also want to add -accepteula key just in case license agreement pops up on first execution.

Another option is using Windows PowerShell Remoting, this way you can utilize built-in PowerShell functionality and won't have to use external utilities. Check out How to Run External Commands and Programs Locally and Remotely from JMeter article for more details.