Not able to test one way websocket using Gatling

已查看 25 次
跳至第一个未读帖子

Rishi Khandelwal

未读,
2017年9月18日 06:44:502017/9/18
收件人 Gatling User Group

Hi All,

I am trying to write Gatling test cases for one way web socket (request is single but response is streaming), but not able to do that.

When I run Gatling test cases, request goes to the server successfully, but Gatling script does not stop and it prints below message in every 5 seconds for infinite time.

























When I convert my request to 2 way websocket, it runs fine, but my use cases it o have one way web socket.

Code snippet:

val httpConf: HttpProtocolBuilder = http
    .baseURL(s"http://localhost:57364/demo/")
    .wsBaseURL("ws://localhost:57364/demo/")
  
  val scn: ScenarioBuilder = scenario("one way websocket")
    .exec(ws("Connect WS").open("streaming/messages"))
    .pause(1)
    .exec(ws("Say Hello WS")
      .sendText("<request>")
      .check(wsAwait.within(30).until(1).regex("200"))
    )
    .pause(1)
    .exec(ws("Close WS").close)

  setUp(scn.inject(rampUsers(3) over (RAMP_OVER_TIME seconds)).protocols(httpConf))

Please let me know how can we make it correct ?

Thanks



回复全部
回复作者
转发
0 个新帖子