Aller au contenu principal

Wait Step

The Wait step pauses the test case for a fixed duration before the next step runs.

When to Use​

  • Allowing time for an asynchronous operation to complete.
  • Waiting for email delivery before checking a mailbox.
  • Rate-limiting between API calls.
  • Giving a service time to propagate data before querying it.

Why: Some side-effects (indexing, email delivery, eventual consistency) are not instantaneous. A fixed wait gives the system time to settle before the next assertion.

Quickest Scenario​

  1. Add a Wait step between two steps.
  2. In the Wait panel, set Time to wait (e.g. 00:00:05 for 5 seconds).
  3. Run. The thread sleeps for the duration, then the next step executes.

Configuration​

FieldDescription
Time to waitThe duration to pause, entered as hh:mm:ss (e.g. 00:01:30 for 1 minute 30 seconds). Default 00:00:05.
Time to wait (display)Read-only formatted display of the same value.

Parameter Reference​

PropertyDescription
TimeToWaitTimeSpan to wait. Default 5 seconds. The step calls Thread.Sleep(TimeToWait) and always returns RunResult.Success.
remarque

The wait is a blocking Thread.Sleep on the step's thread. Keep it as short as reliably works to keep tests fast.

astuce

When you need to wait for a specific event rather than a fixed time, consider the Wait Message step (Kafka / message queue) which returns as soon as the message arrives.

Example​

Step 1: Send Request (POST /register) → triggers a verification email
Step 2: Wait (00:00:10) → let the email arrive
Step 3: Receive Mail
Subject Filter: "Verify your account"

See Also​