Multilocators
As we learned in earlier chapters, CSS and XPath locators support the use of AND and OR operators. What that means is that when defining locators for WebElements or MobileElements in a page object class, users can provide more than one locator to identify the element on the page. If an element ID, class, attribute, tag, or name changes in another release, the locator for that element can be changed in the page object class to support multiple locator types.
So, if the locator being used has some form of text attribute identifying it, and the application is re-branded, the user can wildcard the text to use a partial string match of something in common, or include both text strings using the OR operator, first using the CSS
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access