I am not able to see the logging result, simply I want to see if response code assertion is working. I also dumped result in JSON but also not able to see assertion result
config: target: "abc" logging: console: true phases: - duration: 1 arrivalRate: 10
scenarios:
- name: "API Load Test"
flow:
- post:
url: "abc"
json:
email: "[email protected]"
password: "Admin@123"
name: "Login"
hooks:
afterResponse:
- capture:
- json: "$.statusCode" as: "statusCode"
- | function assertStatusCode(requestParams, response, context, ee, next) { if (response.statusCode === 200) { console.log("Assertion passed: Status code is 200"); } else { console.log("Assertion failed: Status code is not 200"); } return next(); }
- capture:
- post:
url: "abc"
json:
email: "[email protected]"
password: "Admin@123"
name: "Login"
hooks:
afterResponse: