0

I have 5 APIs which uses different form of ids like Uid, Sid and Did . With each request any one from those three is required. List of Uid, Sid and Did are stored in separate CSV file. My req samples looks like

http://Host:port/Users?me=checkUser&Uid=U_User1
http://Host:port/Users?me=checkUser&Sid=S_12
http://Host:port/Users?me=checkUser&Did=D_90101

http://Host:port/AddrUsers?me=checkUser&Uid=U_User1
http://Host:port/AddrUsers?me=checkUser&Sid=S_12
http://Host:port/AddrUsers?me=checkUser&Did=D_90101

Pulling Uid, Sid and Did from CSV randomly is doable but expected is

http://Host:port/Users?me=checkUser&Uid=${UID} or Sid=${SID} or Did=${DID} 
http://Host:port/AddrUsers?me=checkUser&Uid=${UID} or Sid=${SID} or Did=${DID}

So without creating set of three for each APIs I want to pass Param name and Ids to single request [Ignore OR that just to differentiate param. Each request will only have one Id from Uid, Sid, Did]

I am aware about using CSV values through Uid = ${UID} in http request parameters section

Right now I am using 3 cvs and 3 version of same APIs to call the requests with Uids, Sids and Dids

But is it possible to have one CSV having all the Ids (mix of ids) and send those values to each requests randomly?

Finch
  • 71
  • 1
  • 9
  • You can try using [bzm-Random Data Set Config](https://www.blazemeter.com/blog/introducing-the-random-csv-data-set-config-plugin-on-jmeter). This provides a capability to parameterize your Test Plan from a CSV file in random order of records. – Raj May 18 '20 at 12:05
  • @raj Okay.. Values we can take randomly from CVS but, how to change param name with request randomly instead of calling them three time? – Finch May 18 '20 at 12:32

1 Answers1

0

So you should create your bzm-Random CSV set like:

ID,Value //CSV header
UID,UidValue1
SID,SidValue1
DID,DidValue1
UID,UidValue2
SID,SidValue2
DID,DidValue3 and so on...

Under the bzm-Random set check the "Random Order" & "First Line is CSV Header"

and now your URL would be like:

http://Host:port/Users?me=checkUser&${ID}=${Value}

This way you will be able to iterate the values using single request.

Raj
  • 187
  • 1
  • 7