I am new to scala programming, when am trying to feed the CSV data to API request using queryparam giving me junk string. Please let me know am I doing anything wrong?
change line 45 to use queryParam instead: http("Page #{i}").get("/computers").queryParam("p", "#{i}")
observe that it works as expected
There’s absolutely no way “queryParam(“number”,“${Number}”.toString) would generate the URL you mentioned. You can only generate this junk if instead of “${Number}” you’re passing a function but still calling toString on it, which does this: Object (Java Platform SE 8 )
Note: I tried to call queryParm which was mentioned in gatling.io website, but that is also not worked.
How does it not work? Are you sure you’re using Gatling 3.7 where the new #{} syntax was introduced?
@slandelle I am using Gatling 3.8.3 version.
The issue was when am sending the csv data in GET/POST request like below am able to see the CSV content in constructed URL, but when am trying to add the same through queryParm its giving me the above said Junk string.
Dont know queryParm is still not working. will share the entire project by uploading them to Github.
Meanwhile do we have a way to read the CSV file and assign it to some variables in scala class.
Lets say below is my csv file data.
Number, Name
123,Foo
456,Bar
In my scala class I have two variables name & number, using some for loop can I read the CSV file data and assign the values to the variables created in scala class?