Functional Test Refactoring: Extract Page Function
Extract selected test steps to a Page Class (of Page Object Model pattern) as a function. Many testers are aware of Page Object Model, but often don’t do it because time-consuming and error-prone. This refactoring helps! I have been using it many times every working day since 2006.
This is one of the 6 Functional Test Refactorings (see the introduction here):
- Extract Function
- Move Function to Helper
- Move
- Extract Page Function
- Introduce Page Object
- Rename
I have been using “Extract Page Function” refactorings many times daily when working on automated test scripts, since 2006. A quick and reliable practice transform raw test automation steps into a more readable and maintainable version in Page Object Model design.
In my opinion, “Attach test execution to the existing browser” and this “Extract to Page Function” refactoring are the top 2 reasons and practices for my high productivity (10X+ compared to other senior QA engineers) in developing/maintaining high-quality…