- Created by SS Doc Editor, last modified on Sep 27, 2022
Consider recording the following scenario:
- The user logs in and navigates to a grid with records
- Click on a record to display the record details page
- The record details page contains items (each record will have a different number of items)
- Select all items and delete them
- The user logs out
During the test, it is required to parameterize the record to select so that each VU clicks on a different record and deletes every item. The following section describes the steps to emulate selecting all the items in a record and deleting them.
Extract all the item ids.
The first step is to create an extractor from the Record page that extracts all the item ids.
Create an extractor that extracts the first item id.
Example: In this case, we'll use a regular expression extractor with the following definition: "ItemId":"(.*?)"
Set the Occurrence type property to Multiple
To delete all the items at once, the selected item ids must be concatenated into a comma-separated list. Set the Concatenate multiple values property to With double quotes.
Return
Setting the Concatenate multiple values property will cause the extractor to return the following formats:
- With double quotes: "{item1}","{item2}", ... "{itemN}" (use this to concatenate strings or GUIDs)
- Without double quotes: {item1},{item2}, ... {itemN} (use this to concatenate values)
- Parameterize the recorded ids to delete with the extractor
Previous versions
This method was introduced in v5.7. In the previous version, the same could be accomplished using a Scriptable variable.
- No labels