Hi all.
I need create websocket connection with dynamic subprotocol
Example
.exec(http(“get data”)
.post("/v1/data")
.headers(
Map(“Content-Type” → “application/json”))
.body(StringBody(
“”"{
“mobile”:"${mobile}"}""")
)
.check(
status.is(200),
jsonPath("$.data")
.saveAs(“ses_data”)
)
Then i need to use “ses_data” to subprotocol
.exec(ws(“ws connect).connect(”/ws").subprotocol(“here”))
I am trying
- subprotocol("${ses_data}")
- global var inside class Simulation
var data: string = “”
then
.exec( session => data = session.attributes(“ses-data”).toString
then
.exec(ws(“ws connect).connect(”/ws").subprotocol(data))
It is not working. Could you please help me?