Dynamic Test Data
Select existing test data from the recorder, create items inline, and update variables during execution without leaving the flow while recording.
Dynamic Test Data during Recording
We’ve enhanced the test data handling experience within the Recorder to improve usability, reduce context switching, and provide better control over how input data is managed during test creation.
Background
Previously, when recording steps that required input values, users could either:
Enter direct input data, or
Use a variable, which would then automatically be added to the test data set along with its corresponding value.
While functional, this approach required manual entry and did not provide a structured way to reuse existing test data items efficiently.
1. Dropdown-Based Test Data Selection
The standard variable text box has now been replaced with a dropdown menu that lists all existing test data items for the selected test data set.
This allows users to:
Easily select from previously defined test data items
Maintain consistency across test cases
Avoid manual retyping of variable names

2. Inline Test Data Item Creation
Users can now create new test data items directly from the same dropdown interface.
Instead of navigating away from the Recorder screen:
Select the option to create a new test data item
Define the required value inline
Continue recording without interruption
This ensures smoother workflow and eliminates unnecessary screen transitions.
3. Intelligent Selection Logic
If a user selects an existing test data item and leaves the input field blank:
The system automatically retrieves the value from the selected test data item
That value is used during step execution
This reduces redundancy and ensures accurate value binding without additional input.
4. Flow Continuity & Backward Compatibility
The existing logic for creating variables during recording remains fully supported.
When new items are added inline:
They are automatically incorporated into the test data set
The system continues to behave consistently with prior variable-handling logic
No changes are required to existing test cases.
5. Update Test Data During Run time
QApilot supports dynamic test data updates mid-execution using a new "Update Test Data" keyword, allowing the same functional block to be driven by different data values without duplicating steps.


With the new keyword, users can specify a variable name and provide the updated value as the step input.
For dynamic variables, QApilot generates the value at runtime according to the configured rules and assigns it back to the variable automatically.
For static variables, the value is applied directly before the step executes.
6. Custom Test Scripts
QApilot now supports a Custom Test Script type that lets users write lightweight native JavaScript snippets to generate values dynamically at execution time.
This is useful for scenarios where the required test data depends on runtime context - such as today's date, a calculated future date, a formatted string, or a unique identifier - without relying on external data sources or manual updates before each run.
Setting Up Custom Test Script
When creating or editing a test data item, select Custom Test Script from the Data Type dropdown. A code editor will appear where you can write your JavaScript snippet.

The snippet runs once at the start of execution. Its return value is injected into every step that references the variable for the duration of that run.

Writing Your Snippet
Only standard, native JavaScript is permitted - no TypeScript, transpiled code, or external libraries.
The snippet must explicitly
returna value. Execution will fail if noreturnstatement is present or if the script returnsundefined.Maximum length: 1,000 characters.
Examples:
Get a date 5 days from today:
Format today's date as YYYY-MM-DD:
Generate a unique timestamped identifier:
Restrictions
The following are not permitted:
import/require- no external libraries or modulesfetch,XMLHttpRequest,WebSocket- no network accessScripts that return
undefinedor have noreturnstatement
Violations will cause a validation error at the Test Data resolution step, before any test steps run.
Execution Behaviour
The snippet executes before the first test step runs. The resolved value is then used consistently across all steps that reference that variable within the same run.
Viewing Results in Reports
After execution, the Test Data tab in the execution report displays the resolved value - the actual output of the script - alongside the steps that used it. This makes it easy to audit what value was in play for any given run.
Impact
This enhancement streamlines test data management directly within the recording flow, improves reusability of data, reduces manual effort, and ensures cleaner separation between test steps and test data configuration. The addition of Custom Test Script further extends this flexibility to handle time-sensitive, computed, or uniqueness-dependent values without any external tooling.
Last updated