I am new to Jmeter. My HTTP request sampler call looks like this
Path= /image/**image_id**/list/
Header = \"Key\" : \"Key_Value\"
Key value is
You can use a BSF PreProcessor.
First download the Jython Library and save to your jmeter's lib directory.
On your HTTP sampler add a BSF PreProcessor, choose as language Jython and perform your needed magic to obtain the id, as an example I used this one:
import random
randImageString = ""
for i in range(16):
randImageString = randImageString + chr(random.randint(ord('A'),ord('Z')))
vars.put("randimage", randImageString)
Note the vars.put("randimage",randImageString")
which will insert the variable available later to jmeter.
Now on your test you can use ${randimage}
when you need it:
Now every Request will be different changing with the value put to randimage on the Python Script.