Overwrite an Inherited Locator
If you have a class that contains child classes, any locators and fields that are configured for the parent are inherited by the child class. The inherited locators however, are read-only. If you encounter a situation where you want to break the inherited link between the parent and the child classes, you can overwrite the inherited child locator. This means that you can make changes to the child locator without affecting the parent or any sibling classes that have also inherited the same locator. You can overwrite an inherited locator by following these steps:
- Expand the Project Tree and select the class that contains the locator to overwrite.
-
Optionally,
view the class contents if they are not
already displayed.
The hidden class contents are displayed.
- Click Copy Method to copy the locator and its settings from the parent class to the child class.
- Alternatively, select another Locator Method in the list.
- Configure the locator properties.
- Optionally, rename the overwritten locator.