ruby-jmeter icon indicating copy to clipboard operation
ruby-jmeter copied to clipboard

How can I create a property?

Open dadamschi opened this issue 8 years ago • 4 comments

I am attempting to create a property to use data created in a Setup threadgroup in subsequent threadgroups.

How can I set a property similar to ${__setProperty(threads,10,)}?

Apologies if I missed this in documentation somewhere.

dadamschi avatar Nov 02 '16 20:11 dadamschi

I would suggest building a scenario using the following classes. Both of them pretend to create User Define element in JMeter JMX tree.

https://github.com/flood-io/ruby-jmeter/blob/91d3cad535ac95930c3698e844647f744caa58b6/lib/ruby-jmeter/dsl/user_defined_variables.rb

https://github.com/flood-io/ruby-jmeter/blob/91d3cad535ac95930c3698e844647f744caa58b6/lib/ruby-jmeter/dsl/test_plan.rb

PurpleCatfish avatar Nov 17 '18 00:11 PurpleCatfish

@dadamschi you struggle to try, I may try to build one sample for you, just ping me back if it is still needed

PurpleCatfish avatar Nov 17 '18 00:11 PurpleCatfish

        <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
          <collectionProp name="Arguments.arguments">
            <elementProp name="startDateYear" elementType="Argument">
              <stringProp name="Argument.name">startDateYear</stringProp>
              <stringProp name="Argument.value">${__P(startDateYear,2016-12-01)}</stringProp>
              <stringProp name="Argument.metadata">=</stringProp>
            </elementProp>
          </collectionProp>

PurpleCatfish avatar Nov 17 '18 00:11 PurpleCatfish

expected should look like previous message

PurpleCatfish avatar Nov 17 '18 00:11 PurpleCatfish