Search code examples
jmeterauto-increment

Pass auto increment variable in request URL and body if HTTP request in jmeter


I am having a endpoint which accepts a auto-increment integer id as part of path param and in request body also there are some keys which accepts that as well.

For example endpoint is http://foo.bar/{id}

And body is

{
 "someid" : someno+{id passed in url},
 "some world :"fixed string" + "id passed in url"
}

I tried using __counter() directly in place of my {id}, but its not working and in when debugging found that its not replacing the value and its coming as literal only.


Solution

  • Add Counter and call the reference name you defined wherever you want.

    Allows the user to create a counter that can be referenced anywhere in the Thread Group