Hi, for my WebSocket simulation I need to send message to a server and then wait a fixed time for indefinite number of frames as a response.
With Gatling 2.3.1 I was using syntax like this:
import io.gatling.core.scenario.Simulation
import io.gatling.core.Predef._
import io.gatling.core.structure.ScenarioBuilder
import io.gatling.http.Predef._
import scala.concurrent.duration._
class Profile extends Simulation {
val scn: ScenarioBuilder = scenario("Test updates").repeat(1) {
exec(ws("Open socket").open("ws://localhost:8080"))
.exec(ws("Get updates").sendText("get_updates").check(wsAwait.within(20.seconds).expect(0).jsonPath("$.code").not("0")))
}
setUp(scn.inject(atOnceUsers(1)))
}
In this snippet of code, I am sending a command to a server, and after it script waits specified amount of time, receives a messages and checks it for zero error code (I can see it in log).
In Gatling 3.1 there are no “expect” method for messages.
Is there any way to implement logic described above with WebSocket DSL of Gatling 3.1?