Skip to content
CodeKruPro

Check response time in a functional API test

Automation taskMediumJava only

Interviewers ask: "Can you check performance in a REST Assured test?" You can add a simple time limit with time(lessThan(...)), which this lesson practises. Real load testing still needs other tools.

Response Time Validation

Response Time Validation

The /delay/{seconds} endpoint waits before responding. Use response.getTime() to measure response time in milliseconds.

This is critical for performance testing — ensuring APIs respond within acceptable thresholds.

Task: Call the 1-second delay endpoint and verify the response time exceeds 1000ms.

Expected output:

Delayed: 1
Response time > 1000ms: true