Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Parameters are embedded within the test specifications using the following notation:  ${PARAMETER_NAME} for Steps definitions and Unstructured tests,and <PARAMETER_NAME> for Gherkin.

This notation is used to reference parameters within the test steps test definition. You can reference parameters on the Action, Data, Expected Result, and even on any test step custom fields that are in any text-based test step custom field, Unstructured definition, or Gherkin Scenarios.

Parameters are defined within datasets. However, it is possible to reference a parameter that is not yet defined (meaning it does not have a corresponding name within the dataset). In this case, the parameter will be highlighted in red.

Image Added


Datasets

The parameters, along with their values, are defined within a dataset. A dataset is a collection of data represented with a tabular view where every column of the table represents a particular variable (or parameter), and each row corresponds to a given record (or iteration) of the dataset.

...

Section
Column
width20px


Column
Let's consider the following example:

We create created a test for checking to check if we can add books to a shopping cart in our online book store. We have parameters like Item, Price, Rating, In Stock, Condition, and Format. There are certain books we want to test (3 in this case). However, we would like to test all combinations of these books with the following parameters: Gift and Quantity

In this case, these will be the seeding parameters:

  • Item,
  • Price,
  • Rating,
  • In Stock,
  • Condition,
  • Format

Because we want to test these items with all the combinations of Gift and Quantity parameters, we can create these as Combinatorial parameters: 

  • Gift*
  • Quantity*

Combinatorial parameters are denoted with an asterisc (*) suffix. 



Xray will generate all possible combinations upon execution automatically. 

...

All iterations for a given test are executed within the context of the same test run. Each iteration can be expanded and the steps executed individually. The step parameters will be replaced by the corresponding iteration values. The steps affect the iteration status that, in turn, affects the overall test run status.


Image Added


Please check the Execution page for more details.

...

Info
titleTest environments improvements

We have plans to improve how test environments are managed in Xray. It will be possible to specify or generate combinations of environments for different variables.

Please check our roadmap.

Defining a parameterized test

...

Manual Steps

  1. Create or edit a given step using either the inline view within the test issue or the steps dialog.
  2. When specifying a step, to reference a parameter you have two options:
    1. Start typing ${. If there is a default dataset defined on the test, you should see a list of the available parameters. Choose the desired parameter using the cursor keys or mouse. The parameter will be placed with the text.
    2. Use the toolbar button ${. After pressing this button, and if there is a default dataset defined on the test, you should see a list of the available parameters. Choose the desired parameter using the cursor keys or mouse. The parameter will be placed on the cursor position.

Generic or Unstructured definition

  1. Edit the definition using the inline view within the test issue.
  2. To reference a parameter, you have two options:
    1. Start typing ${. If a default dataset is defined on the test, you should see a list of the available parameters. Choose the desired parameter using the cursor keys or mouse. The parameter will be placed with the text.
    2. Use the toolbar button ${. After pressing this button, and if there is a default dataset defined on the test, you should see a list of the available parameters. Choose the desired parameter using the cursor keys or mouse. The parameter will be placed on the cursor position.

Image Added

Gherkin Scenarios

  1. Create or edit a given step using either the inline view within the test issue or the steps dialog.
  2. When specifying a Scenario, to reference a parameter you should start typing <. If there is a default dataset defined on the test, you should see a list of the available parameters. Choose the desired parameter using the cursor keys or mouse. The parameter will be placed with the text.

Image Added

Creating a dataset

...