Create a New Locator/Element
In order to define a new web locator, follow the steps below:
1- Click Add while on Web Locators tab. You can select Folder to create a folder to organize your web locators. To create a new locator, select Locator.
2. This will This open up the New Web Locator window. If you have created locators before, the previously used page and frame information will automatically be filled on the web locator form.
3- Advanced View icon on the top left of New Web Locator form will switch to editor mode where you can copy the content of the locator and then Grid View takes you back to the above view of New Web Locator definition
4. On the window in Step 2, specify the Web Page which is an editable drop-down (best practice is to use application name followed by “_” and followed by page name, for example myApp_login, myApp_search, etc.), Type (another editable drop-down), and Alias for the locator you are defining along with only one unique identifier. This identifier can be the Web ID, Name, Partial Text, CSS Selector, or XPath of the widget. These options can be viewed under Locator Strategy and only the active option will be used.
- If the locator is on a frame, you need to define the frame by clicking Yes under Located in a Frame? and using the frame XPath. If you have nested frames, you can include the XPath’s for all the frames separated by “;”
- If the widget is on a popup window, you need to include a text or phrase that uniquely identifies that popup (only exists on that popup) and add it by clicking Yes under Located in a Popup?
- If you have XPath specific to each type of browser, you can include that under Browser Specific section of locator and populate XPath in the Chrome, Firefox, Edge or Safari XPath. These XPaths have priority over the general XPath identified.
For best results with XPath/CSS, you can use our Smart XPath/CSS Generation Engine to generate your XPath values.
5- Click the Save & Close button to save your locator. Once saved, your newly defined locator will show up in the locator listing on the Web Locators screen. In order to see the relevant elements, you can filter them using Key, Web Page, XPath, CSS Selector, Frame, Owner, State, or Popup.
6- Inject Template will allow you to parametrize any of the locator fields shown above. In order to do this, click on any of the above fields and when the field turns blue, click on Inject Template then select Data Template and Field and click Inject.
Tip
Web Page, Frame and Popup values are saved from one locator definition to the next to make it easier to define locators on the same page.
Tip