Versions Compared

Key

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


Include Page
XRAY:Scripts
XRAY:Scripts

Image Removed

UI Expand
titleTable of Contents

Table of Contents

Introduction

Scripts define the Test steps and expected results for each Test scenario. They provide clear instructions for testers, ensuring consistency in how scenarios are executed.

By using the Xray Test Case Designer Scripts feature, you can standardize Test execution and ensure repeatability, making your Tests more reliable and well-documented.

You can quickly transform optimized Test data as depicted in Figure 1 into customizable scripts (Figure 2).

Figure 1 - DataImage Removed

Figure 1 - Data

Figure 2 - ScriptsImage Removed

Figure 2 - Scripts

Info

You can add automatically generated expected results to your steps (Figure 3 - 2).

Figure 3 - ResultsImage Removed

Figure 3 - Results

Operations

Accessing Scripts

UI Steps
UI Step

In the Xray Test Case Designer, click My Test Models (Figure 4 - 1) and then click a Test model (Figure 4 - 2).

Figure 4 - Test modelImage Removed

Figure 4 - Test model

UI Step

A menu will open on the left. There, click Scripts (Figure 5 - 1) and select one of the two options: Automate / Manual (Figure 5 - 2).

Figure 5 - ScriptsImage Removed

Figure 5 - Scripts

Creating/Editing Scripts

Automate

Automate (Figure 5 - 2) allows you to create Gherkin feature files as behaviors for your generated Test cases.

Editing a Script

UI Steps
UI Step

Go to Scripts (Figure 5 - 1) and then click Automate (Figure 5 - 2).

UI Step

Click the pencil icon to edit the script's name (Figure 5 - 3) and the trash icon to delete the script (Figure 5 - 3).

UI Step

Use the dropdown menu to select the strength of interactions (Figure 5 - 5).

UI Step

Click the grey background to edit the script's text and write anything you want (Figure 5 - 6).

UI Step

Once you're done editing, click the Save button (Figure 5 - 8). This button will become active as soon as you make a change in the text field (Figure 5 - 6).

Info

You can click the Usage button (Figure 5 - 7) to see some tips on creating a script.

Creating a Script

...

UI Step

Go to Scripts (Figure 5 - 1) and then click Automate (Figure 5 - 2).

UI Step

Click the + icon (Figure 5 - 4).

...

A modal will open (Figure 6).

There, enter the name of the new script (Figure 6 - 1) and select a type (Figure 6 - 2).

Figure 6 - ModalImage Removed

Figure 6 - Modal

Once you're finished, click Create (Figure 6 - 3).

UI Step

The newly generated script will now appear in a tab (Figure 7 - 1).

Figure 7 - New scriptImage Removed

Figure 7 - New script

Manual

...

UI Step

Go to Scripts (Figure 8 - 1) and then click Manual (Figure 8 - 2).

Figure 8 - ScriptsImage Removed

Figure 8 - Scripts

UI Step

The screen for the manual script will open (Figure 9).

Here, you can write the script instructions by hovering and clicking the script fields (Figure 9 - 1) and entering a description. Once you're finished writing the instructions, always click Save (Figure 9 - 2) before moving to the next step.

Figure 9 - ScriptImage Removed

Figure 9 - Script

UI Step

You can edit/delete a step (Figure 10 - 1) and add the expected results to it by clicking the Add Expected Results button (Figure 10 - 2). A modal will open (Figure 11).

Figure 10 - ResultsImage Removed

Figure 10 - Results

...

Here, you’re setting up a simple “when / then” rule (Figure 11 - 1; 2; 3). 

Figure 11 - ResultsImage Removed

Figure 11 - Results

You’re not restricted to rules with just one positive condition - you could also create a rule that reads is not by clicking is (Figure 11 - 2).

If when (Figure 11 - 1) is blank, the expected result from the then field (Figure 11 - 3) will apply to that step in all Test cases, regardless of the Test data.

Once you're finished, click Add (Figure 11 - 4).

...

Expected Results Feature

...

This feature provides a partial solution for straightforward Expected Results, allowing you to avoid manually typing many simple results. However, it is not designed to handle particularly complex rules.

...

If you need to define an Expected Result that requires three or more specific values to appear in a single Test script (and you are creating pairwise sets of Tests), use the Forced Interactions feature or a higher combination strength to ensure the scenario is included in your suite. Then, use the Manual scripts feature to document the Expected Result for export.

Xray Test Case Designer Automate scripts can leverage the last column in Forced Interactions directly as an internal variable.

If your Expected Result requires two or fewer specific values to appear in a single Test script (and you're creating pairwise sets of Tests), use the Manual scripts feature without additional prep work.

UI Step

Select the interaction by using the dropdown menu (Figure 12 - 3).

Figure 12 - ScriptImage Removed

Figure 12 - Script

UI Step

In the Finish field (Figure 12 - 4) you can add some instructions that will appear only once at the end of all of the scenario scripts.

Info
As long as you save the field descriptions as you go, your Manual script will also be saved and updated.

...

titleSupport/Troubleshooting

...