...
- Click on New on the Locator Repository tab
This will open up the New Locator tab as follows:
- Advanced View of Locator tab 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 Locator
- Clicking on References for a given locator will display all of the test cases that contain that locator. The purpose is to ensure that the same locator is not created more than once, and that a locator is not mistakenly modified.
- On the above tab, specify the Web Page which is an editable dropdown (best practice is to use application name followed by “.” and followed by page name, for example myApp.login, myApp.search, etc.), Type (another editable dropdown), 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. If more than one of these values is specified, Subject7 Functional will use the first one that it finds based on the order mentioned above and will ignore the rest.
- If the locator is on a frame, you need to define the frame by 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
- If you have XPath specific to each type of browser, you can include that under XPath in the IE XPath, Safari XPath, etc. These XPath’s have priority over the general XPath identified
- Hit the Save button to save your locator. Once saved, your newly defined locator will show up in the locator listing on the Locator Repository screen. In order to see the relevant elements, you can filter them using Key, Web Page, XPath, CSS Selector, Frame, Owner, State, or Popup.