How to generate or parameterize UUIDS for each occurrence in one request

Hi All,

We are working on a thick client application , there is request which has lot of ID’s (unique one’s) in the request body.
we need to parameterize the each occurence in the request body and there are 1700 occurrences approximately, so how do we handle this.
UUID generator works for each Iteration, do we have something similar to do for occurrence or do we have any different approach for sending parameters for each occurrence within on request.

example of Json request

“ResultType”: 1,
“Entity”: {
“Id”: “24216282-957a-440c-9b66-3b63c0f14da4”,
- - – - —
-------------
-------------
}
},
{
“ResultType”: 1,
“Entity”: {
“Id”: “8c0c5524-0f31-4dea-9701-1bbe9865c63d”,
---------------
---------------
---------------
}
},
{
“ResultType”: 0,
“Entity”: {
“Id”: “50c3b87f-2b8b-430e-8df5-67093a98f48f”,
------------------
------------------
------------------
}
},

Hi

UUID generator works for each Iteration

I don’t understand what you mean here. What are these UUIDs? I guess they are not random but must match some state in the database. Probably ids that come from a list sent by the server. If so, you have to feed them from a test data file or capture them from a previous response from the server.

Hi
This is .NET desktop application. So what happens here is these ID’s are generated on client side and are pushed to DB. so there is need to generate unique ID’s for us in gatling.

There’s a random UUID generator in Gatling Expression Language: Gatling - Expression Language

or you can use a pebble template.

Hi,
After taking a look at [Gatling - Expression Language] page, found out below function

// generate a random UUID String (standard java.util.UUID#randomUUID: cryptographically secure, but slower)
"#{randomSecureUuid()}"

can we use this function for generating unique UUID’s for each one?
this function is available only in Gatling 3.9 version.

Hi @harsa,

// generate a random UUID String (fast but cryptographically insecure)
"#{randomUuid()}"

// generate a random UUID String (standard java.util.UUID#randomUUID: cryptographically secure, but > slower)
"#{randomSecureUuid()}"

Both work for generating UUID, I bet you’ll need only the first one (faster) because the need for the second one is rare.

Yes, this community forum assume to be up to date.

Cheers!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.