Search code examples
performancejmeterperformance-testing

Need to execute command via jmeter


I have a scenario where I need to use jmeter to run numerous Kubectl commands via jmeter os sampler snippet: tried to execute kubectl get pods but still not been through, OS sampler

getting the response as -- 'kubectl' is not recognized as an internal or external command, operable program or batch file.

OS sampler response


Solution

  • The error means that kubectl command is not on your Windows system PATH, add it there and restart JMeter.

    Otherwise you can provide the full path to kubectl

    Also be aware that k8s has REST API so it might worth considering switching to HTTP Request samplers, see REST API Testing: How to Do it Right article for more information.