33 / 80 · 12 Programming for QA · OOP for Testing← prev⊞ allnext →☰ Read as one page
4.7Practical Exercise
Build a page object framework for a simple e-commerce site:
- Create a BasePage with common utilities (wait, scroll, screenshot)
- Create a NavigationComponent used across multiple pages
- Create ProductListPage and CartPage using composition
- Write 3 tests that use your page objects without any locators in the test file
- Refactor: change a locator in a page object and verify no tests need updating