Saturday, April 1, 2023

Selenium Custom Locators

Selenium Web Driver supports both Xpath and CSS Locators as element locator strategies. As these strategies are comprehensive ideally there is no need to provide other abstract strategies such as ID and Class, but providing such strategies OOTB the designers of Selenium have lowered the entry barrier to automation using their library. So as framework developers you can take this further and provide other custom locator strategies to the users. The snippet below shows how a custom by class can be made to wrap around the XPath contains function.






No comments:

Post a Comment

What's in my Bag? EDC of a Tester