The Group Context feature enables you to run groups of steps on other, slightly different, elements (contexts), without the need to manually reconfigure the steps. When setting a context for a group step, the locators in its steps are automatically and dynamically changed to fit the new context.
For example, if you created a group of steps for booking a reservation to Madan and you want to run that group for booking a reservation to Shenji, instead of manually changing the step details, Group Context will automatically make the appropriate adjustments for you.
For background information about Groups and Shared Groups, see Groups.
Examples of when you may want to use this feature include:
- Repeating elements – when you have similar elements repeating in the page and want to execute the same steps on each of them.
- Table rows – when you want to execute the same steps on each row in a table.
- Tabs or frames – when you want to use a group of steps, which were recorded on one tab, in another tab.
The following procedure assumes that you have already created a shared group step that you would like to reuse in a new context. The procedure for creating a group is described here.
To set a context for a group:
- Click the “+” button > Groups Tab.
- Select the desired group from the list of existing group steps.
- Hover over the group step you just added and click on the Show Properties () icon.
The Properties panel opens on the right-hand side.
- Click the down arrow next to Context, and select Custom.
- If your AUT (application under test) browser is not currently open to the relevant page, you will be prompted with a message to "Open base URL" or "Run test to relevant step". Click on Run test to relevant step. In this case, you will need to click on Custom again once the AUT is ready.
The AUT browser opens.
- In the AUT browser, identify the relevant element (context) you would like your group to run on, and click on it to select it.
By default, when selecting context for a group, the application will be in "Context selection mode". In this mode the repeating elements on the page will be highlighted to help with the selection. To exit this mode and return to the normal selection mode, click Q on your keyboard.
- The selected element is shown in the Target element box in the Context section of the Properties panel.
The new context is automatically applied to the group step, with no additional need for you to reassign the step.
Testim automatically identifies which steps in the group should run on the provided context, and which should run outside of it.
Click here to view a test where a group step has been applied to more than one context. Use the shared group step “book” to create a new booking for a different destination in the app by changing the Context of the group step.
Updated 10 days ago