Response time
This is a pre-built action available under @Assertion element type. It checks whether the API response time is within the expected limit to validate the performance and responsiveness of the API request.
Syntax
Input Value: <Expected response time in ms>
<Expected response time in ms> (Required)
Specify the expected time in milliseconds to compare with actual time.
Output Value: <Actual value>(optional);<Keyword Status>(optional)
<Actual value>
(Optional)
The actual value stores the response time extracted from the executed API.
<Keyword Status>
(Optional)
The keyword status variable stores the status as True or False.
Example: Validating Response Time Using Less Than Condition
In this example, we verify that the API response is received in less than the specified response time.
Action: Response time
Input Value: >2000
The value 2000 specifies the expected response time in milliseconds.
Output Value: {Actual Time};{Action Status}
The first output variable {Actual Time} stores the actual API response time in milliseconds.
If the second output variable {Action Status} is defined, it stores the operation status with the following possible values:
True: If the actual response time is less than 2000 milliseconds.
False: If the actual response time is greater than or equal to 2000 milliseconds.
Logical Explanation: The Response time action fetches the expected response time 2000 milliseconds from the Input Value column and compares it with the actual API response time using the Less Than (>) condition. The actual response time is stored in the {Actual Time} variable. If the {Action Status} variable is defined, it stores True when the actual response time is less than 2000 milliseconds.

Last updated