Hi Domingos Creado,
Thank you for your interest.
So, what I’m trying to do with my code is that I have several files that are called finishTask1, finishTask2 , … and so on. I’m repeating some code for each one of those. This repeated code goes to create the file with some values from a feeder file and then execute a soap request with the generated file.
val finishTask =
repeat(filesCount, “loopCounter”){
exec( session =>{
val id = session(“loopCounter”).as[Int] + 1
session.set(“id”, id)
})
.feed(jsonFile(filteringFileName))
.exec(createFile)
.exec(http(“Finish Task”)
.post(workflowWSService)
.headers(header)
.body(RawFileBody(“finishTask”+_.get(“id”).as[Int]+".xml")))
}
My problem is that I repeat this whole scenario several times as well with different feeder files. Think of the feeder files as pages and I want to make the finish task requests for a number of pages:
object Data {
var groupList : List[Int] = (1 to (repTimes)).toList
def branchByGroup() : ChainBuilder = {
var c : ChainBuilder = exec(session => {
val id = session(“repCounter”).as[Int] + 1
println("repNumber = " + id)
session.set(“repNumber”, id)
})
groupList.foreach( x => {
c = c.doIfEquals( (session => session(“repNumber”).as[Int]) , x) {
exec( new FinishTask(workflowWSService, “EditFilteringResult” + x + “.json”, repTimes).finishTask)
}
})
return c
}
}
val scn = scenario(“Finish Task After Validating Purchase Quality”)
.repeat(repTimes, “repCounter”){
exec(Data.branchByGroup())
}
for the first loop iteration(first page), the files are created and the requests are made successfully, but for the next iterations, while the files are overwritten, the requests still aren’t changed and the first feeder file requests the ones executed.
I tried disabling the cache and exec(flushHttpCache) but it’s the same.
Thank you.