2
votes

How can I execute a curl command in OS process Sampler in jmeter?

I have below command that need to be executed in OS Process Sampler.

curl -k -O http://localhost:9763/filedownload?id=/ushani-com-30786.cert

Please check the attached screenshot and it is not working. What am I doing wrong? Please advice.

OS Process Sampler config

2
Why not using http sampler instead of curl?user7294900

2 Answers

1
votes

Replace in your command field #!/bin/bash to curl
and delete curl from command parameters.

And also add View Results Tree listener - so you'll be able to see what jmeter trying to execute!

0
votes
  1. Replace your #!/bin/bash with /bin/bash
  2. Add -c as the first argument

    JMeter Curl OS Process Sampler

See How to Run External Commands and Programs Locally and Remotely from JMeter article for more details.


Also be aware that according to JMeter Best Practices users are strongly encouraged to use the latest version of JMeter so consider migrating to JMeter 3.3 (or whatever version is available at the Downloads page) on next available opportunity.