The Agile Way — Practical Automated E2E Testing

The Agile Way — Practical Automated E2E Testing

Reader Question: Using Helper Functions or Page Object Model in Automated E2E Test Scripts? *

Test design option: when to use helper functions or POM.

Zhimin Zhan's avatar
Zhimin Zhan
Mar 27, 2026
∙ Paid

In this new series (exclusive to paid members), I will answer specific questions I’ve received from readers and from audiences at presentations.

  • What’s your view on test prioritization in test automation? *

  • Coverage of Happy and Alternative (Negative) Paths in E2E Test Automation? *

  • Using Helper Functions or Page Object Model in Automated E2E Test Scripts? *

  • How do test automation engineers raise Many Defects and Still Get Along Well With Developers? (planned)

  • “What Do You Do If You’re Facing Roadblocks in Your Software Testing Career?” (upcoming)

  • How Can I Handle Interruptions as a Senior Software Developer and Test Automation Coach? (upcoming)

Below is a high-quality question received yesterday from a paid member.

The question reveals that this test automation engineer is far above the industry averages.

  1. Understand ‘Maintainable Automated Test Design”

  2. Concerns the readability of the automated test script syntax, beyond the framework and basic working.

To simplify the question, let’s see three versions of a user login test.

v1: raw script

it “user login” do 
  #...
  driver.find_element(:id, "username").send_keys("agileway")
  driver.find_element(:name, "pwd").send_keys("testwise")
  driver.find_element(:xpath, "//input[@value='Log in']").click 
  # ...
end

v2: Using helper function

it "user login" do 
  #...
  login("agileway", "testwise")
  #...
end

v3: Using Page Object Model (POM)

it "user login" do 
  #...
  login_page = LoginPage.new(driver)
  login_page.enter_username("agilway")
  login_page.enter_password("testwise")
  login_page.click_login
  #...
end

v1 is not optimal because it is hard to maintain. A competent test automation engineer should be able to refactor it quickly into v2 or v3. (TestWise IDE’s refactoring support greatly simplifies the effort).

Both v2 and v3 are good, but which one is better?

User's avatar

Continue reading this post for free, courtesy of Zhimin Zhan.

Or purchase a paid subscription.
© 2026 Zhimin Zhan · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture