Add Context Clicks
The Context Click command is used to parameterize an element click in relation to a reference text. By selecting a reference text, which is then parameterized, you can dynamically change the element that is clicked by altering the reference parameter value.
Context click on the cart button in the context of "<product>"
:
- Here, the
"<product>"
param value can be changed to parameterize which product gets added to the cart.
Adding a Context Click Step
Navigate to the relevant page where you want to add the verification step during Recording.
In Recording mode, click the plus icon at the top right to open the Manual Steps box.
Select Add a context click command. The context selection box will appear.
To add a context, first click to select the reference text that will be parameterized, then click the associated element. Both the text and element click will be recognized in the context selection box.
Click Save to add the new context click command to the recording.
Open the three-dot menu for the step and select Generate names. A parameter will be created for the selected context, and the step name will be updated to reference the parameter.
TIP
Playback recorded steps using Run Scenario to verify them before publishing the recording. You can also modify the Conext parameter value before playback.
Customizing Context Parameter Values
You can modify the parameter value so that during each run, a different element is clicked. For example, in the following scenario, the user has added multiple example rows to the scenario, so that in each iteration, a different product is added to the cart.
NOTE
Don't forget to Publish your scenario after finalizing all your steps.