how can I set request names dynamically?

Hi All,

I have a csv data file consist of different type of queries. I feed the data to my tests as follows:
val feeder = csv(dataFilePath).unzip.random

val perf_test_scenario: ScenarioBuilder = scenario(“Search”)
.feed(feeder)
.exec(“request name”)
.get("${query}"))

Is there a way that I can set the request name dynamically based on the type of query?

Regards,
Maruf

Hi

You might be able to create an extra column in your csv data file named “requestname” and then data bind it similar to how you have done the .get("${query}"). Also your code will need to change a bit

CSV File
requestname, query
req1, “query/1/findsomething”
re2, “query/2/findsomethingelse”

Code
val feeder = csv(dataFilePath).unzip.random

val perf_test_scenario: ScenarioBuilder = scenario(“Search”)
.feed(feeder)
.exec(http("${requestname})

.get("${query}"

Note that I added the “http” after the “exec” and data bound it to the new field in the csv file.

Please let me know if that worked

Thanks
Jason