Inline XPaths allow you to enter own own XPath in a step without having to create a web locator which gives you the option to create test cases faster. However if you are planning on interacting with elements in several test cases where these elements could potentially change and would require maintenance, it’s best to use web locators as changing the XPath in one web locator automatically takes effect in all other test cases, while changing Inline XPath steps only applies to the step in which this change is made.
Inline XPaths are supported in the following commands:
Check
Clear
Click
Double_Click
Drag_And_Drop
Execute_Javascript
File_Upload
Fill
Get_Web_Value
Hotkeys
Hover
Hover_And_Click
Multi_Action
Right_Click
Screenshot
Scroll_To
Scroll_To_Dynamic
Select
Submit
Verify_Element
Verify_Text
Verify_Text_in_PDF
How to Use Inline XPaths
To use Inline XPaths, simply bring up one of the commands above in your test case
Select “XPath” from the dropdown list and enter your XPath in the textbox next to the dropdown list.
You can run this test to make sure that this element is interacted with, in this case it will be clicked.
You can also convert this step from Click to another command by clicking the dropdown list highlighted below and selecting which new command to use
Once your selection is made, click Apply
Check your new command to ensure no information is missing. For example, if you choose Get_Web_Value, you will need to enter a variable name and possibly change the Type depending on your scenario
Converting Inline XPaths to Web Locators
In order to convert an inline XPath to a web locator, click on the Right Arrow next to XPath field
You will be prompted to use the recently used page name and frame information. If you do not wish to use them, click No.
Enter the required information (Web Page, Type and Alias) and save your web locator
After saving, you will notice that Locator option was automatically picked and the web locator you created has been selected: