19:24:09.390 [ERROR] i.g.c.a.InnerWhile - Could not evaluate condition: Can’t cast value $HOWMANY of type class java.lang.String into int, exiting loop
Once I get past this obstacle, I will next increment the USERID in the subsequent loop.
fixed the error. However, I am kind of lost. Was looking for examples, but could not find!
I want to read the starting ID and iterate, say N times and the value N is fed from a file.
Do I need a separate function or Java code?
.feed(csv(“getuserinfo.csv”))
.repeat(3){ //this work. How to read the counter from a file?
exec(
http(“Info”)
.post("${protocol}://${IPAddress}/api/v1/SessionService.svc")
.headers(MYHeaders.getMyInfoHeader)
.body(StringBody(SOAP_REQUESTS.soapGetUserInfoRequest))
.check(status.is(200))
).pause(1 milliseconds)
}
I spent enough (?) time going through the Scala and Gatling-2 documentation before coming back here. Still, I couldn’t come up with a working solution.
My problem is a simple one. I want to read sets of 2 values (start and loopnumber) from a CSV file. Send SOAP requests n-number of times beginning with the starting value increment in each iteration.
getuserinfo.csv:
startingNumber,HOWMANY
8,3
3,7
4,300
For the first line, send request with 8, 9 and 10 (3 times)
second loop will send 3,4,5,6,7,8,9,10 (7 times)
and so on.