Skip to content

Define API Request Parameter: REQUEST_PARAMETER

The Define API Request Parameter command is used to define key-value pairs required for service requests. These parameters will be added to the API request during execution.

Example: Configuring Parameters for an API Request

Suppose you are testing an API to fetch user account details, and the API requires two parameters: username and password.

Steps to Configure:

Step 1: Define the “username” Parameter

  1. Open the Case where you need to use this command.
  2. Add a new step at the required index.
  3. Select Define API Request Parameter from the Action dropdown.
  4. In the Element Key field, enter the name of the request parameter key (e.g., username)
  5. In the Parameter section, enter the corresponding value for the parameter key. You can use:
    • A hardcoded value (e.g., john_doe for the username) or
    • A dynamic value using variable referencing syntax (e.g., ${TestUsername}).
  6. Click Save.

Note: While the steps for adding an action command are identical in both views, the display of the steps changes:

scrn-define-api-request-username-parameter-tabular-view
Tabular View
scrn-define-api-request-username-parameter-card-view
Card View

Step 2: Define the “password” Parameter

  • Action: Select Define API Request Parameter
  • Element Key: Enter password
  • Parameter: Enter securePassword123 (or ${TestPassword} if using a variable).
  • Click Save.
scrn-define-api-request-password-parameter-tabular-view
Tabular View
scrn-define-api-request-password-parameter-card-view
Card View

Notes:

  • You should define all headers between Start Api Request and End The Api Call
  • It is recommended to define headers after Define Api Request Resource command to ensure the request is properly structured.

Example Workflow:

The following screenshot illustrates how the Define API Request Parameter command is structured within an API test case in HuLoop.

scrn-example-workflow-define-api-request-parameter
Workflow showing the Define API Request Parameter step in an API automation sequence

Expected Outcome on execution:

  • The key-value pairs (username and password) will be added to the API request.
  • The automation workflow will send these parameters to the API endpoint.

 

Back To Top