Mayank pandey
Mayank pandey

Reputation: 81

How to add key with unique random value in HTTP Request defaults in Jmeter

I am trying to apply load sample request is like

http://54.174.110.64:8080/adserver/html5/inwapads/?adFormat=preappvideo&ak=O4DCX2&version=1.0&adu=5&cb=1494853894218&output=vast&priority=1&size=[vdo_adSize]&pageURL=http://qa.vdopia.com/qa/Ruchi/ssp_preroll1.html?0.7888977&domain=vdopia.com&refURL=&category=[CATEGORY]&siteName=vdopia&displayManager=Vdopia-SPP-Web&di=[COOKIE_ID]&dif=fpcm&sex=[GENDER]&age=[AGE];ipAddress=203.122.9.130;di=abcdefghijklmn

I have single request, what I want is that same request should have unique di (last key in query param). Nothing else I want to change.

My test is based on unique di in request keeping other parameters constant.

Upvotes: 0

Views: 732

Answers (3)

Mayank pandey
Mayank pandey

Reputation: 81

I have used below approach : Jmeter

ad di=${di_random}in path of HTTP request

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168072

I would suggest using __UUID() function which will generate a GUID structure which is unique according to the underlying algorithm each time being called.

If you don't like dashes you can remove them via __groovy() function like

${__groovy("${__UUID}".replaceAll("-"\, ""),)}

Demo:

JMeter generate unique value

See Apache JMeter Functions - An Introduction to get started with JMeter Functions.

Upvotes: 1

Masud Jahan
Masud Jahan

Reputation: 2978

You can use Random function.

Hint:

enter image description here

Upvotes: 2

Related Questions