Product Update: A new testing step “Set variable”

A new testing step that can significantly streamline your testing workflows by reducing the number of changes you might need to make to your testing Scenarios.

New testing step

We introduce a new testing step “Set variable”. With this step, you can create a variable, assign a value to it, and then use it as many times as you need within the Scenario with any other type of testing step. You can then take a step further and use Macros to set variables across all Scenarios in your Project.

A “Set variable” testing step has two fields. The first one is for the variable name, which can include letters, digits, and underscores. The second field accepts a string value or a JavaScript expression (plain JS, without any references to any libraries or frameworks).

To use this:

  1. Add a “Set variable” step.
  2. Specify a name for the variable (letters, digits, and underscores are allowed).
  3. Provide a string value or a valid JavaScript expression.
  4. When using the variable, preface its name with a dollar sign $.
💡
The value should correspond with the testing step type you will be using the variable with. For example, if you're using a variable with a “Click” step, it should be something that DogQ can use as a selector. If you're plugging it into a “Go to URL” step, the value should be a URL address, etc.

Variables can also be used to manage dynamic and unpredictable elements. For instance, when working with automatically generated links, you can store the URL in a variable. This variable can then be used with the standard testing steps “Go to” and “Check url”.

Minor tip

When you need to input text with multiple paragraphs in the “Type into” step, simply use the newline character “\n” in your text to indicate a new paragraph.

What’s next?

In June, we will introduce a new and more informative Test Runs page. Additionally, we plan to create an environment that supports the application of Variables to API executions.

Other features are on our roadmap. If you want us to prioritize a specific feature, let us know at [email protected].