With group context, you can run an entire group on different subsets of your application, by providing the elements as a "context" to the group.
Let's do an example scenario on this demo site, where we want to verify the "book" button works as expected (i.e clicking book on the destinations leads to the checkout page).
Record the steps
First, we'll record the flow:
- Click "Select destination"
- Click "Book" on "Madan" destination.
- Validate "Checkout" title appears.
4. Select step 3 and 4 , and group them together to a "Book" group.
Use the group in a different context
Now, let's use the same group of steps to check if "book" button works as expected on a different destination :
- Record a scroll and click on "select destination" to see the destinations again
- Select the "Book" group we created
- Open the properties panel
- Choose "Custom" in "Context"
- Choose the element you would like the group to run on, in this example we choose "Tongli"
When setting a context to a group, the locators in it's steps are dynamically changed to fit the new context. There's no need to reassign the steps manually.
To see this test and run it click here.
Examples for using group context
- Repeating elements : when you have similar elements repeating in the page and want to execute the same steps on all of them.
- Table rows : when you want to execute the same steps on different rows in a table.
- Tabs or frames : when want to use a group of steps recorded on one tab, in another tab.
- By default, when selecting context for a group, the application will be in "Context selection mode". In this mode we will highlight the repeating elements to help with the selection. You can always hit ‘Q’ to exit this mode and go back to the normal selection mode.
- Testim automatically identifies which steps in the group should run on the provided context, and which should run outside of it.
- Please keep in mind that this feature is in beta, more improvement to come!