Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 457
dhairya Avatar asked Oct 26 '25 04:10

dhairya


1 Answers

  • List item

you should do three-step of below

  1. go to the random variable according below picture enter image description here

  2. Define random variable name . in this case we set variable name to code1 and set min & max value to this

enter image description here

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

enter image description here

like image 120
moien ghorbani Avatar answered Oct 28 '25 02:10

moien ghorbani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!