11
Echo Location – Skipping the Page Object Model
So far, we have used the Page Object Model (POM) to encapsulate the UI elements and interactions with a page within an object. We can usually see our target objective clearly with the XPath or CSS locator, but consider the superheroes who get the job done blindly in the dark. While the POM has many merits, there are scenarios where finding objects by text alone, in the dark, based on some clues, can offer advantages:
- Quick prototyping and simplified test creation: For quick and dirty testing or prototyping, it might be overkill to establish a full-fledged POM of thousands of objects. In such cases, directly locating elements can speed up the initial test development process.
- Handling elements ...
Get Enhanced Test Automation with WebdriverIO now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.