Configure input values to be dynamically generated or define static values that can be overridden for use in data-driven testing scenarios.
Variables allow you to define input values which can either change on every test run based on your specifications, or be set to a static value that you can override when you run a test. Here’s a few examples of when a variable comes in handy:
Testing Your Registration Flow: Being able to register a user is often one of the most important end-to-end tests you can create. However there’s one big challenge with creating automated tests for this flow: once you’ve registered an email address/username in your system, you can’t register it again. By associating a variable to the username / email address in your test, and assigning it a dynamically generated value, you can ensure that your test registers a new user every time it runs.
Data-Driven Testing: Setting an input value to a variable with a static value allows you to override that value in future test runs. This enables data-driven testing scenarios where you pass in different input values on every test run.
To define a variable, create a recording or view an existing recording and select the Input step that you’d like to associate with a variable. After selecting the Input step, you’ll see a Use Variable button in the Detail view:
Clicking on this button will open a modal which lists all of the variables you’ve previously created, along with a form that lets you add a new variable:
Either select an existing variable or add a new variable and then select it, then click the Select Variable button to associate it with your Input step.
To generate a dynamic value for a given variable,
alphanum function in your variable definition.
Each of these functions outputs a series of random letters and/or numbers
equal in length to the number passed into the function.
||Call me, 0149783430|