k6 load testing

Add think time between steps

Medium70 pts~25 min
  • Think time
  • Pacing
Practice app · Checkout Service

A load-testable checkout service with realistic latency that degrades under concurrency, plus a live metrics view.

BASE_URL
/api/practice
Console app
/lab/sdet-add-think-time-between-steps

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Insert realistic pauses between user actions so load resembles real users.

Your task

  1. 1Set options { vus: 3, iterations: 9 }.
  2. 2GET BASE_URL + "/perf/search?q=tee", sleep(1), then GET BASE_URL + "/perf/checkout", sleep(1).
  3. 3check status 200 on both; optionally randomise with sleep(0.5 + Math.random()).

Acceptance criteria

  • Search and checkout return 200
  • sleep() is used
  • ≥ 18 requests are sent
  • At least 18 check() calls pass

k6 load testing · SDET · Scripting basics