sqljmeterblazemetertaurus

Problem passing user defined variables (JMeter Script)


I don't know how to pass User Defined Variables (from JMeter .jmx Script) on jenkins-taurus.yml (Taurus BlazeMeter configuration file). It keeps pushing the fixed variables: [1]: https://i.sstatic.net/igIK3.png

I need these fields (User Defined Variables) to be blank, and the info inside them to be pushed from the Taurus configuration file:

As you can see, I'm trying to pass the parameters through Taurus configuration file (.yml) [2]: https://i.sstatic.net/kMpRx.png

SI need to know how to pass these variables inside Taurus script, should I use user.{userDefinedParametersHere} or is there another kind of syntax?

This is necessary because the server URL and login/password could be changed easily this way.


Solution

  • You're using incorrect keyword, if you want to populate the User Defined Variables via Taurus you should use variables, not properties

    ---
    execution:
    - scenario:
        variables:
          foo: bar
          baz: qux
        script: test.jmx
    

    It will create another instances of User Defined Variables called Variables from Taurus

    If you additionally need to disable all existing User Defined Variables instances you could do something like:

    ---
    execution:
    - scenario:
        variables:
          foo: bar
          baz: qux
        script: test.jmx
        #if you want to additionally disable User Defined Variables:
        modifications:
            disable:  # Names of the tree elements to disable
            - User Defined Variables
    

    If you have defined your variables at Test Plan level - don't worry, just override them via Taurus and the script will use the "new" values (the ones you supply via variables keyword)