how to declare the user defined variables in yaml

1,669 views
Skip to first unread message

Anant Patil

unread,
May 22, 2018, 7:43:50 AM5/22/18
to codename-taurus

Hi,

Can you please let me know ,how to declare the variable with its value in yaml,as I tried the below config file.

My user defined variables in the below config file are(JMETER_PATH,SCRIPT_PATH).As the variable name not replacing by its value at run time please let me know.

--- 
execution: 
  - 
    executor: jmeter
    scenario: simple
    variables:
     - jmeter_path: "D:/apache-jmeter-3.1"
     - script_path: "D:/apache-jmeter-2.12/bin/C4C_perf"
modules: 
  jmeter: 
    path: '{{ jmeter_path }}'
    properties: 
      jmeter.save.saveservice.autoflush: "false"
      jmeter.save.saveservice.connect_time: "false"
    version: 3.1
reporting: 
  - 
    module: final-stats
  - 
    module: console
  - 
    module: blazemeter
scenarios: 
  simple: 
    script: '{{ script_path }}/C005.jmx'

 

Andrey Pokhilko

unread,
May 22, 2018, 8:37:21 AM5/22/18
to codenam...@googlegroups.com

Hi,

You should differ between JMeter variables, which work inside JMeter, and environment variables, which work in YAML.

Looks like you need env variables, look here: http://gettaurus.org/docs/ConfigSyntax/#Top-Level-Settings

--

Andrey Pokhilko
Open Source Initiatives Leader
CA
          BlazeMeter

22.05.2018 14:43, Anant Patil пишет:
CAUTION: This email originated from outside of CA. Do not click links or open attachments unless you recognize the sender and know the content is safe.

--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/479fd508-6e12-4d21-b00c-3e6a10aaa1d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anant Patil

unread,
May 22, 2018, 9:14:29 AM5/22/18
to codename-taurus
Hi Andrey,Thank you for your quick reply.

    As I mentioned in the previou mail jmeter_path,script_path are my normal variables and those are not set in environment variable section,

    I want to know how to declare user defined variables and use that in config file.Please let me know

Andrey Pokhilko

unread,
May 22, 2018, 10:50:55 AM5/22/18
to codenam...@googlegroups.com

You cannot use JMeter variables inside YAML, as you showed in your example. Only settings.env variables can be used like that.

--

Andrey Pokhilko
Open Source Initiatives Leader
CA
          BlazeMeter

22.05.2018 16:14, Anant Patil пишет:

Anant Patil

unread,
May 22, 2018, 12:56:19 PM5/22/18
to codename-taurus
Hi Andrey,

Thank you,Can we execute multiple jmx in multiple machines via taurus?

Andrey Pokhilko

unread,
May 22, 2018, 1:06:10 PM5/22/18
to codenam...@googlegroups.com

Only with BlazeMeter cloud provisioning, unless you want to configure JMeter servers yourself and configure their addresses in YAML.

--

Andrey Pokhilko
Open Source Initiatives Leader
CA
          BlazeMeter

22.05.2018 19:56, Anant Patil пишет:

Anant Patil

unread,
May 23, 2018, 7:37:30 AM5/23/18
to codename-taurus
HI Andrey,

I tried the below config file and its worked fine in local.Please let me know the below points.

1.I am unable to trace the in which machine which script is running.

2. In distributed execution,jmeter need to be installed in slave and jmeter-server need to be running ryt?Taurus will not take care in slave right?.

3. Actually I want to execute one jmx in one node another one in another machine.


--- 
execution: 
   #- executor: jmeter
  - scenario: simpleOne
  - scenario: simpleTwo
    distributed: 
    - 10.174.16.156
    - 10.174.18.145
modules: 
  jmeter: 
    path: "${jmeter_path}"
    properties: 
      jmeter.save.saveservice.autoflush: "false"
      jmeter.save.saveservice.connect_time: "true"
    version: 3.1
reporting: 
  - 
    module: final-stats
  - 
    module: console
  - 
    module: blazemeter
    project: "UK Group"
    report-name: "Performance Report"
    test: Smoke
  - 
    criteria: 
      - "avg-rt>5s for 10s,continue as failed"
    module: passfail
scenarios: 
   simpleOne: 
     script: "${script_path}C005.jmx"
   simpleTwo: 
     script: "${script_path}C004.jmx"
settings: 
  env: 
    jmeter_path: "D:/apache-jmeter-3.1"
    script_path: "D:/apache-jmeter-2.12/bin/C4C_perf/"

Andrey Pokhilko

unread,
May 24, 2018, 10:18:54 AM5/24/18
to codenam...@googlegroups.com

Hi,

Your configuration is invalid. You have configured one scenario to run locally and other to run remotely on two machines. The right config would be:

--- 
execution: 
  - scenario: simpleOne
    distributed: 
  - scenario: simpleTwo
    distributed: 
    - 10.174.18.145

--

Andrey Pokhilko
Open Source Initiatives Leader
CA
          BlazeMeter

23.05.2018 14:37, Anant Patil пишет:
Reply all
Reply to author
Forward
0 new messages