Load Testing · Middle · Question 17 of 76

A login endpoint should return 401 for wrong passwords in your test. How do you keep it out of http_req_failed?

Show the answer

Correct answer: Mark 401 as expected: http.setResponseCallback(http.expectedStatuses(200, 401))

Explanation

The response callback decides which statuses count as success for http_req_failed and the expected_response tag.

Further reading

Problem with a question

Load Testing · Middle · question 17

Test yourself

Take the Load Testing · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz