Bird
0
0

You want to test your REST API's login endpoint under heavy load using Locust. Which approach best simulates realistic user behavior?

hard📝 Application Q15 of 15
Rest API - API Testing and Monitoring
You want to test your REST API's login endpoint under heavy load using Locust. Which approach best simulates realistic user behavior?
ACreate a task that sends POST requests with different user credentials and add wait times between requests
BSend continuous GET requests to the login endpoint without any delay
CRun a single user sending POST requests in a tight loop
DOnly test the API with one user to avoid server overload
Step-by-Step Solution
Solution:
  1. Step 1: Understand realistic load testing

    Realistic load testing simulates many users with varied data and natural pauses between actions.
  2. Step 2: Evaluate options for realism

    Create a task that sends POST requests with different user credentials and add wait times between requests uses different credentials and wait times, mimicking real user behavior. Others either overload or under-test the API.
  3. Final Answer:

    Create a task that sends POST requests with different user credentials and add wait times between requests -> Option A
  4. Quick Check:

    Use varied data and wait times for realism [OK]
Quick Trick: Add wait times and varied data for realistic load [OK]
Common Mistakes:
MISTAKES
  • Sending requests nonstop without delay
  • Testing with only one user
  • Using only GET requests for login

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes