Search code examples
jmeteruuidwiremock

Use placeholder (or generate unique id) using wiremock with jmeter


I'm using JMeter for load test, and mocking external service using wiremock.

I'm using JSON files to mimic the responses from those external service, one of the

{
"response":"459ada78-842b-4229-b9d8-4dcdb52aa738"
}

It is very simple response with only 1 UUID field, the problem is on my side this is must be unique everytime i call the service

Is there any way to regenerate that id from the mock file or using some kind of placeholder instead of static value


Solution

  • Use JMeter's __UUID function

    ${__UUID()}
    

    will return UUIDs with this format : c69e0dd1-ac6b-4f2b-8d59-5d4e8743eecd