0

Problem:

I am currently hard coding a password in my jmeter .jmx test file. I want to be able to either set this in the config.yaml or on the command line using something like a "-o modules.jmeter.properties" switch (to replace this in the CI pipeline)

However I cant get either of these to actually replace the value in the .jmx file.

I have looked through the Taurus doco and ended up trying the following.

Updating the config.yaml file:

execution:
- executor: jmeter
  scenario:
   script: ../scripts/apigee_loadtesting.jmx
   data-sources:
    - ../datafiles/
 concurrency: 2
 ramp-up: 30s
 hold-for: 1m
 steps: 2

modules:
  jmeter:
    properties:
      es.password: P@ssw0rd!

Also tried this from the commandline:

bzt ../config.yaml -o modules.jmeter.path=/usr/local/apache-jmeter-4.0.2/bin/jmeter \
-o modules.jmeter.properties.espassword=P@ssw0rd! config.yaml

But neither of them seem to do anything meaning, Any suggestions would be appreciated

Community
  • 1
  • 1
Scotty G
  • 11
  • 1
  • 6

1 Answers1

1
  1. Taurus itself will not change anything in the .jmx script, just make sure that you refer the property using __P() function as ${__P(es.password,)} in the .jmx script and the value will be substituted with the one from .jmx file or command-line override.
  2. I would avoid using dots in properties names as it might cause problems with overriding properties values from the command-line. So stick to espassword everywhere if possible
  3. The change your command line so config.yaml would be the last argument like:

    bzt -o modules.jmeter.path=/usr/local/apache-jmeter-4.0.2/bin/jmeter -o modules.jmeter.properties.espassword=P@ssw0rd! config.yaml
    

See Navigating your First Steps Using Taurus article for more information on running JMeter tests using Taurus

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • That seems to have done the trick. I can pass it in from the commandline. i do a similar thing with the thread, steps etc. Couldnt get it to work for this previously. Cheers for the help – Scotty G Sep 04 '18 at 10:37
  • I'm running a performance test jenkins job configured using taurus. I have existing jmeter jmx file which i would like to run with this job. This jmx file is expected to read inputs from jenkins job inputs. So, i configured jmx file as said by @Dmitri T with $_P() for reading inputs, but still the values coming as empty during test run. Any help would be very much appreciated. – naresh goty Aug 06 '19 at 22:54