Skip to main content
There are two ways to make network requests as part of a test:
  1. Simple GET requests inline as a test step
  2. cURL requests that run before the test starts (pre-requests)

Inline GET requests

You can make a GET request directly in a test step and use the response data in subsequent steps.

Example: retrieving an OTP code

Assuming there is an endpoint to retrieve an OTP code:
With a response like:
You can use the following test steps:
Step 1 makes the request and remembers the otp_code from the response. Step 2 uses the extracted value by referencing it as “remembered”. You can use environment variables (e.g. {{env.username}}) as part of the URL. For more complex requests like POST or DELETE with payloads, use pre-requests instead.

Pre-requests (cURL)

Pre-requests let you execute cURL commands before the test starts. This is useful for setup tasks like cleaning data, creating test accounts, or fetching credentials.

Step 1: Define the cURL commands

Navigate to the Settings tab within your test. In the Pre-requests section, define one or more cURL commands that will be executed sequentially before the test runs. Examples:

Step 2: Define values to remember

If a pre-request returns values you want to use in the test, specify them using dot selector syntax. For example, given this response:
You can define username and password as values to remember in the pre-request settings.

Step 3: Use remembered values in the test

Reference the remembered values in your test steps using the “remembered” keyword: