artillery
artillery copied to clipboard
parsing acknowledgement to json
Version info:
1.7.0
Running this command:
config:
target: "http://localhost:8000"
socketio:
path: "/ws/socket.io"
transports: [ "websocket" ]
phases:
- duration: 1
arrivalCount: 1
scenarios:
- engine: "socketio"
flow:
- emit:
channel: "start_recording"
data: null
acknowledge:
match:
json: "$.0.code"
value: 200
- think: 10
I expected to see this happen:
match pssed
Instead, this happened:
Errors: Failed match:1
and when I checked the data it is just string in the '0' value like this: socketio [Arguments] { socketio '0': '{"code": 400, "body": {"message": "audio params required"}}' socketio } +0ms
and to pass the match I should use the exact string in the value like this: match: json: "$.0" value: '{"code": 400, "body": {"message": "audio params required"}}'
Isn't the match failing because code
in the response is 400
but the match
expression expects it to be 200
?
Hi, Thanks for your response. No I checked that also, I think the problem is parsing the data to json, I should use the raw string to pass the check