Reputation: 539
Need to add unique value every time/always when run the POST api request in jmeter. I have API which is POST request, this request added 'roleId' which should be unique every time (should not use the id which was already created). I have tried below options but response says duplicate id. 1. Add http request with POST body> add 'Counter' to this request with min: 25 and max: 50 with increment:1 When run the request it always starts with '25' and it fails from the second run as it says duplicate value because in the first run this id has been inserted in table 2. User defined variables: used __Random function but for this also same issue. 3. CSV data set config: same issue.
Please suggest what would be the best approach to solve the issue.
Upvotes: 0
Views: 2021
Reputation: 168072
9e73f1a6-c1dc-44f7-b73a-508871f98b83
1492417676453
(it won't help if you have > 1 request in millisecond)You can use any combination of the above in order to generate your roleId
, if you have doubts let us know the criteria so we could come up with the best solution. In the meantime check out Apache JMeter Functions - An Introduction article series to get the overall idea about using Functions in JMeter tests.
Upvotes: 4