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.

Zhimin Zhan
Geek Culture
Published in
8 min readMar 21, 2023

--

This is one of the 6 Functional Test Refactorings (see the introduction here):

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…

--

--

Zhimin Zhan
Geek Culture

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.