Web Locators Settings (since v5.7.1)
Starting 5.3, Katalon Studio has allowed users to set default Web Locator in Project Setting > Test Design > Web Locators.
This setting helps the user eliminate the repetitive tasks of selecting/deselecting locators for each captured objects while recording or spying the AUT. The locators in this setting will be applied to all captured objects in Record and Spy Web.
Requirement: You need to have an active Katalon Studio Enterprise License.
Web Locators Settings
Relative XPath (Beta)
- By default any New Projects created will use the XPath option, the old projects created in Katalon Studio version 5.6 and below will remain using the Attributes option.
- XPath option does not apply to Internet Explorer. Internet Explorer will always use Attributes option.
- The web locator Selection Method also carries over to Record Web Utility, Spy Web Utility, and Test Object View.
Katalon Studio supports Relative XPath for better object recognition. If an element cannot be consistently located using its direct attributes, Katalon Studio will identify by using its more robust neighbors. That is a simple but powerful idea behind the New locator method introduced in Katalon Studio. This method is visually intuitive as it reflects the way users often identify a visible element on the user interface.
- Locates Web elements by clustering visualization.
- Preserves the relationship between an element and its indicator in an item.
- Generates reliable locators to reduce test script maintenance cost.
Drag and drop any XPath on the list to change its priority. Katalon Studio will use the first XPath as default to locate the elements, and the rest of the list will be leveraged to locate the element if the first one failed.
Captured objects will have properties listed as below:
Katalon Studio also supports the regular XPath with locator strategies available in Selenium. Custom locators can be added to the list as well. Pre-selected locators are those recommended by the Katalon team.
By default, tag property will be selected. In some cases you don't want this behavior so that you can change this by:
- Add a new property called tag and deselect it
When you spy or record test steps, any object having this tag property will not be used by default.
Working with Angular pages, there are two properties called ng-model and ng-pattern you would like to use it by default. Added these two properties to the list of current Web Locators.
These selected properties will be checked by default when you Spy or Record your test steps