0

I have below setup for my test plan:

enter image description here

In POST http request, I am sending a variable myCount set to value 0.

As per above configuration, this test will run 100 times but everytime the value of myCount is sending 0.

I want it in incremental for example: for loop 1 value set to 1, for loop 2 value should set 2.

Please let me know how can I achieve this.

Also, I would like to know in Taurus as well.

1

1 Answer 1

2
  1. Thread Group has a pre-defined variable which returns the current iteration number, it's ${__jm__Thread Group__idx}

    enter image description here

    if you want the counting to start from 1 - go for __intSum() function

    enter image description here

  2. There is __counter() function which generates an incremented number each time it's being called

    enter image description here

  3. There is Counter configuration element which does the same but you have additional possibility to control the number format, i.e. if you need 0001 instead of just 1 or you plan to re-use the generated variable value later on within the bounds of same request or iteration. More information: How to Use a Counter in a JMeter Test

  4. With regards to Taurus - in case of JMeter executor it supports all the approaches mentioned above

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you @Dmitri T. Would be great if we get similar in Taurus yaml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.