Hi,
I want to do something that seems relatively simple to me using the websocket API.
Given a stream of messages like
:
I want to check that messages from each user come with continuously increasing sequence numbers (1,2,3,…) not (3,1,2,…) or (1,2,4,…). I want to continue run this check for as long as the scenario runs, and I do not know how many messages will come. I asked the same question on SO, but did not yet get any answers: http://stackoverflow.com/questions/35361878/stateful-checks-in-gatling-websocket-scenario
First of all: how do I arrange for the check to be active until closed explicitly and accept an unbound number of messages? Will the following work to check if all messages are “ok” until the ws is cancelled?
.exec(ws(“WS”)
.open("/indexWS?userId=${userId}&accessToken=${accessToken}")
.check(wsListen.within(Int.MaxValue.seconds).until(Int.MaxValue).message.find.is(“ok”))
)
// some other stuff happening
.exec(ws(“WS”).cancelCheck)
.exec(ws(“WS”).close)
Second: how do I keep a state of type Map[String, Int] to remember the last sequence number for each number? It seems that the WS API only allows saveAs of type String?
Thanks in advance for your help,
Rüdiger