Variables in TestDriver allow you to dynamically store and reuse data during test execution. This feature is particularly useful for handling dynamic content, passing data between steps, and customizing test behavior based on runtime conditions.
Generate a random number or string and use it to fill out a form.
Capture API responses and validate their content.
Capture text or values from the screen and use them in assertions.
Pass different values to the test using environment variables for testing multiple scenarios.
By leveraging variables in TestDriver, you can create dynamic, flexible, and reusable test scripts that adapt to changing conditions and data.
version: 5.1.0steps: - prompt: Generate a random number commands: - command: exec output: randomNumber js: | result = Math.floor(Math.random() * 1000); - command: exec js: | console.log("Generated Random Number: ${OUTPUT.randomNumber}"); - prompt: Use the random number in a form commands: - command: hover-text text: Enter Number description: Input field for numbers action: click - command: type text: ${OUTPUT.randomNumber}