July 2019
Intermediate to advanced
536 pages
12h 57m
English
Before we discuss using dynamic, XPath, and CSS locators, let's review again the standards for retrieving WebElements from outside the page object classes.
In keeping within the Selenium Page Object Model, locators go in the page object classes, but not in the utility classes, the test classes, or the data files. Users will often try to cut corners and embed the WebElement class's FindBy methods within the test methods themselves, rather than encapsulating the locators in the PO classes.
This is the wrong approach, and leads to maintenance nightmares when locators, text, values, tags, and links change in the application. We only want to have to make a change in one place when a locator changes. ...
Read now
Unlock full access