0
votes

I need to execute the jmx file from OS process sampler. I am getting the error

Response code: 500 Response message: Exception occurred whilst executing system call: java.io.IOException: Cannot run program "jmeter -n -t C:\test\jmeter\reliability\scripts\test.jmx" (in directory "C:\apache-jmeter-4.0\bin"): CreateProcess error=2, The system cannot find the file specified

Here is my values in the OS process sampler.

Command: jmeter -n -t  C:\test\jmeter\reliability\scripts\test.jmx


Working directory: C:\apache-jmeter-4.0\bin
2

2 Answers

0
votes

You better use Include Controller to run additional jmx

The include controller is designed to use an external JMX file. To use it, create a Test Fragment underneath the Test Plan and add any desired samplers, controllers etc. below it.

0
votes

Your approach is a little bit wrong.

Whatever you provide into Command input field will be treated as a single command or filename, it won't be split into jmeter.bat file with parameters as it's something done by the cmd.exe interpreter

So you need to amend your OS Process Sampler configuration as follows:

  • Command: cmd.exe
  • Working directory: C:\apache-jmeter-4.0\bin
  • First argument: /c
  • Second argument: jmeter.bat -n -t C:\test\jmeter\reliability\scripts\test.jmx

enter image description here

Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.1.1 or whatever is the latest stable version available at JMeter downloads page on next available opportunity.