'How to pass the dynamic value in Body data in the Post Request using jmeter

I recorded the .JMX script in Jmeter and one of the request is as below

POST http://www.hello.com/auth/nqa/md/login

Body data: {"domainId":"nqa","code":"12345skdkdk"}

I would like to send the "code" field dynamically and for that I added the regular expressing extractor as below enter image description here enter image description here

enter image description here

When i re run the script , the code value is not replaced with the dynamic value.

Not sure what part i am missing in the regular expression extractor or in the Body data field



Solution 1:[1]

you should do three step of below

  1. go to random number option

enter image description here

  1. define random variable name . in this case code1 and set min & max value to this

enter image description here

  1. user ${code1} variable to your data section

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 moien ghorbani