...
The recorder supports the following commands:
Click
Double_Click
Right_Click
Fill
Clear
Select
Hover
Alert
Switch_Window
Close_Popup
Check
Drag_and_Drop
Verify_Element
Verify_Text
Get_Web_Value
The recorder has two recording modes:
Interactive Mode: in this mode, you will be required to enter a hint/label that can be used to generate XPaths for your test case. This mode always generates relative XPaths.
Silent Mode: in this mode, you will not be required to enter a hint/label, everything will be captured automatically. This mode uses absolute XPaths by default, unless you have created XPath Templates with relative XPaths.
Note: Refer to Set Preferences to a Test Case (User Execution Preferences) to activate/deactivate the recorder and switch between modes.
...
6- You can switch between recording modes at anytime during recording. To learn how to do this, please visit Set Preferences to a Test Case (User Execution Preferences)
7- You can determine where a new step is added as follows:
...
XPath Templates are used to store XPaths by the user which can be used in the Recorder in Silent Mode. By default, silent mode uses absolute XPaths to traverse to elements, but by using XPath Templates, you can add relative XPaths which will by dynamically used by the algorithm to generate relative XPaths for you. Here’s how it works:
Example:
Relative XPath is captured using Interactive Mode: //a[contains(text(),'LOGIN')]
XPath Template is created which contains the XPath: //a[contains(text(),'$LABEL')]
User starts recorder with Silent Mode and clicks on an element to capture it:
If the XPath in the template works with this element, a step is created with the relative XPath
If the XPath in the template does not work with this element, a step is created with the absolute XPath. For example /html[1]/body[1]/div[1]/div[1]/div[1]/div[3]/div[2]/a[2]
XPaths can be separated by creating several XPath Templates and adding different descriptions for them, but generally the recorder will use all available XPaths from all templates to match your case and if no match is found, an absolute XPath will be used.
...
The following scenario will show you how you can practice XPath Templates:
Start a new test case and navigate to the website https://reference.subject-7.com
While Silent Mode is active, click Capture on the platform
Click Login link on the page
A new step with Click command will be added on the platform. Notice that the XPath is absolute.
Switch to Interactive Mode and record the same link one more time
A new step with Click command will be added on the platform. Notice that the XPath is now relative
Stop the recorder by clicking Stop Recording on the platform
Copy the relative XPath from your step and go to
...
Repository > XPath Templates on the platform
Create a new XPath Template and replace LOGIN with $LABEL. Save the XPath Template and close it
Switch back to Silent Mode and Start the recorder. Now capture the element one last time
Your new step will now use a relative XPath which was used from your XPath Template