Getting specific records from a feeder.

Hi,

I am trying to implement below case using gatling and need your help to do that.

File1.csv :
id, remoteId
1, 10
2, 20

File2.csv :
remoteId, description
10, test1
10, test2
20, test3
20, test4

I need to feed from first CSV file and loop through only the records from second CSV that matches the condition like

val file1 = csv(“File1.csv”).circular;

val someFunction = (remoteId) {
// This should loop though the File2 and return only the record that matches the passed remoteId
}

feed(file1)

val records = someFunction(${remoteId})

// loop through records in print description.

Please let me know how can i achieve it? Thanks.

Hi,

You can try dynamic csv file names. e.g.

File1.csv :
id, remoteId
1, 10
2, 20

10.csv :
remoteId, description
10, test1
10, test2

20.csv:

remoteId, description

20, test3
20, test4

val scn = scenario(“foo”).feed(csv(“File1.csv”).circular) {

foreach("${remoteId}", “fileId”) {

feed(csv("${fileId}.csv"))
.exec {

}
}

Thanks,
Alex.