Scenarios: reuse groups of steps
Group steps like "Sign in", nest them, and add one test inside another.
What a Scenario is
A Scenario is a named, coloured group of steps, like "Sign in", "Search a product" or "Check out".It makes a long test readable at a glance, and lets you reuse a part of one test in another.
Group steps
- 1
Select the steps
Drag a rectangle around the blocks that make the part, for example everything from typing the user name to the welcome check.
- 2
Press Ctrl+G
Or right-click a block and choose Scenario, Group into Scenario.Give it a name and a colour.
Group steps that already belong to a Scenario and you get a Scenario inside it: "Check out" can hold "Enter the address" and "Pay".
Work with a Scenario
| To | Do this |
|---|---|
| Move the whole part | Drag the Scenario's chip.Dragging one block moves only that block. |
| Select its steps | Right-click the chip, Select Its Blocks. |
| Copy or duplicate it | Select the chip and press Ctrl+C then Ctrl+V, or Ctrl+D.The copy keeps everything inside it. |
| Undo the grouping | Right-click the chip, Ungroup (Ctrl+Shift+G).The steps stay. |
| Rename it or change its colour | Right-click the chip, Edit, or press F2 with it selected. |
The Scenarios panel
As soon as a test has a Scenario, a Scenarios panel joins GUI Test Studio's left column.It lists every Scenario as a chip in its colour, with a Scenario inside another shown under it, and the time it spans.Click one to select it on the timeline, double-click it to go there and move the playhead to its start.
Add another test inside this one
You recorded "Sign in" as a test of its own.Every other test starts by signing in.Instead of recording it again each time, add the "Sign in" test to them as a Scenario.
- 1
Put the playhead where it belongs
Usually at the very start.
- 2
Choose File, Add Test as Scenario
Or press Ctrl+Shift+I, and pick the test file.Its steps, checks and recording arrive as one Scenario.
Record a new part
Right-click the timeline where the new part belongs and choose Record New Scenario (Ctrl+Shift+R).GUI Test Runner-Recorder records it, and it arrives in your test at that moment as a Scenario.
Scenarios in the report
The Confidence Report shows each step's Scenario with its colour, says in which Scenario a run stopped, and can show the steps of one Scenario only.
Still stuck?Tell us what you were trying to do, and we answer within one working day.Ask our team