How to run Jmeter tests from bamboo?

3.2k Views Asked by At

How to run the Jmeter tests from bamboo? I tried in Jenkins which has the 'Execute windows batch command' option and I just pasted these lines and worked fine

jmeter -n -t C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\test.jmx 

I need to work the same with bamboo as well. So I tried with the script task, selected Inline and in the script body I pasted the above lines It failed with this error

/opt/bamboo/current/temp/TEST-NEW-NEW-33-ScriptBuildTask-6294682377804302931.sh: line 2: C:Jmeterapache-jmeter-2.13bin: command not found

/opt/bamboo/current/temp/TEST-NEW-NEW-33-ScriptBuildTask-6294682377804302931.sh: line 3: jmeter: command not found

I tried with the Command task also in bamboo but no luck.

I'm struggling how to run Jmeter tests from bamboo? Anyone please advise. I see that we can do it with maven I believe, but I don't know much about it, but if anyone has step by step instructions that I can follow that helps as well.

Thanks in advance

3

There are 3 best solutions below

2
On

Define the jmeter executable as a remote capabiliety.

Then add a new command to your task and select jmeter as executable. Add your arguments and you are done.

1
On

It looks like that you need to either need to escape backslashes like:

C:\\apache-jmeter-2.13\\apache-jmeter-2.13\\bin\\test.jmx

or change them to forward slashes as:

C:/apache-jmeter-2.13/apache-jmeter-2.13/bin/test.jmx

Other options on how to kick off a JMeter test from Bamboo build step are:

See 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide for detailed information on aforementioned options.

0
On

I assume your Bamboo is in a linux environment.

From Bamboo on Linux, create a new task and select script:

cd /<your path>/apache-jmeter-2.13/bin
./jmeter -n -t <your path>/test.jmx 

If Windows, set environment variable JMETER_HOME to C:\apache-jmeter-2.13\apache-jmeter-2.13\ and then on Bamboo's command line:

cd C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\ 
jmeter -n -t test.jmx