Argument feature

Prev Next

You can use the Argument feature in JavaScript steps, Playwright code steps, and Natural Language steps.

By using this feature, you can pass any value—such as data values, results from other steps, or workspace variables, etc.—to JavaScript steps, Playwright code steps, and Natural Language steps to create flexible and dynamic scenarios.

Instructions

1. Define arguments

When adding or editing a JavaScript step, Playwright code step, or Natural Language step, configure the Arguments in the Arguments section of the dialog.

  1. Click + in the Arguments section of the step edit screen.

  2. Enter an arbitrary argument name in Argument name.

  3. Click Add to add the argument to the list.

2. Set argument values

Select an input source from the dropdown and set the value you want to pass to the added Argument.

3. Use arguments in code/Natural Language steps

The configured Arguments can be used directly as variables within the code editor.

For JavaScript steps

You can use the argument name as a variable directly in the JavaScript code.

Example: If you defined the argument username

// Enter the value of the argument username into the element with ID 'login'
document.querySelector('#login').value = username;

For Playwright code steps

You can use the argument name as a variable directly in the Playwright code.

Example: If you defined the argument targetUrl

// Navigate to the URL of the argument targetUrl
await page.goto(targetUrl);

For Natural Language steps

You can use the argument name directly in the prompt of the Natural Language step.

Example: If you defined the arguments loginuser and loginpassword

Input loginuser in the username field and loginpassword in the password field, then click the login button to log in.

Note

Natural Language steps with arguments cannot be converted to no-code steps.

Use cases

Using Data values

This is effective when you want to test using different input data (such as email addresses or passwords) with the same operation steps.

  1. Prepare data (e.g., email, password columns) in the scenario.

  2. Define arguments email and password in the code step or Natural Language step.

  3. Set the input source of each argument to Data and select the corresponding column.

  4. Use these Arguments in the code/prompt to perform form inputs, etc.

Using results from other steps

This is used when you want to use a dynamic value generated in a previous step (such as a member ID or order number) in a subsequent code step.

  1. Place a step that generates or retrieves a dynamic value (e.g., "Generate random value" step).

  2. Define an argument (e.g., orderId) in the subsequent code step.

  3. Set the input source of the argument to Other step's output and select the target step.

  4. Use orderId in the code/prompt to perform verification or operations.

Notes

  • Data types

All arguments are passed to the code as Strings. If you want to use them for calculations as numbers, please convert them to a number type using Number(argumentName) or parseInt(argumentName) in the code.