Keeping the page-specific details off the test script

The ultimate aim of the PageObject pattern design is to maintain the page-specific details, such as the IDs of the elements on the page and the way we reach a particular page in the application, away from the test script. Building your test framework using the PageObject pattern should allow you to keep your test scripts very generic and not need a modification each time the page implementation details change. Finally, whenever there is a change done to a web page, such as a login page, the number of changes that need to be done for 50 test scripts that use this page should ideally be 0. Just changing the PageObject should handle adapting all the tests to the new changes.

Get Selenium WebDriver 3 Practical Guide - Second Edition 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.