Reuse input data across multiple steps with variables
Variables are useful when a value input during test recording needs to be reused later within the same test. It helps in
- Eliminating hardcoded values
- Maintaining tests easily. You can update the variable at one place rather than modifying it across multiple test steps.
- Making tests more readable and self-explanatory by assigning meaningful names.
When to use variables?
- Use variables when dealing with repeated static values across different steps within a test. For eg:-
- Validate full name or email in accounts profile section after logging in
- Validate pricing details on checkout page after selecting a particular plan
-
When the test requires dynamic input that may change during each test run which has to be consumed at a later point in the test.
- Use variables to centralize and manage data, for making tests easier to update and maintain.
How to create and use a variable?
Creating a variable can be done at any step where you have to input values. Whereas, reusing the variable can be done at any step where you have to input values or add a text validation.
Creating a variable
- Navigate to the step where you have an input value which has to be reused
- Click on the step name or the “>” icon to open the step configuration details
- Click on “Convert to variable” below the text input
- Give a unique meaningful name to the variable and save it
Importing a variable
- Navigate to the step where you want to reuse the variable created
- Click on the step name or the “>” icon to open the step configuration details
- Click on “+” and select “Import a variable” if the step is an input step or click “{}” icon besides the text input if the step is a text validation step
- Import variable in Input step
- Import variable in Text validation step
- Select the relevant variable you want to import
Managing a variable
-
Managing a variable is possible at any step where the variable is in use. You can navigate to the step configuration details and edit the variable to any value of your choice.
-
Additionally, Low Code Automation also allows you to manage your variables from a single configuration page where you can edit any variable value and delete any variable that is not in use. Click on the “⚙” icon to access the page.
- A variable can only be deleted when it is not used in any other steps.
- A variable can not have a variable within it.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!