Python SDET Bootcamp

Python SDET Bootcamp

Lesson 59: Mobile Page Object Model

HandsOn Automation Bootcamp's avatar
HandsOn Automation Bootcamp
May 16, 2026
∙ Paid

The Junior Trap: “I’ll Just Find the Element Directly”

Picture a fresh automation engineer handed their first mobile test task: “Automate the login flow.” They fire up Appium Inspector, grab the XPath, and write this:

# ❌ The Junior Trap
def test_login():
    driver.find_element(By.XPATH, '//android.widget.EditText[@resource-id="com.app:id/username"]').send_keys("admin")
    driver.find_element(By.XPATH, '//android.widget.EditText[@resource-id="com.app:id/password"]').send_keys("pass123")
    driver.find_element(By.ID, "com.app:id/login_btn").click()
    time.sleep(5)  # "give the app time to load"
    assert driver.find_element(By.ID, "com.app:id/home_header").is_displayed()

Then they copy this exact pattern into test_profile.py, test_checkout.py, and 14 other test files — always grabbing the locator fresh, always trusting time.sleep.

Why this destroys you in CI/CD:

  1. Maintenance explosion: When the dev team renames com.app:id/login_btn to com.app:id/btn_login (happens every sprint), you now have a grep-and-replace hunt across 15 files. In a pipeline running at 2 AM, this means a red build nobody can explain.

  2. time.sleep(5) is a lie: On a cloud device farm (BrowserStack, Sauce Labs), network RTT varies from 80 ms to 4 seconds. sleep(5) either wastes 4.9 seconds or fails intermittently. In a 200-test suite, that’s 16+ minutes of wasted wait time — guaranteed.

  3. Zero reuse: Every test re-invents the same interactions. You’re not building a framework; you’re building technical debt.


Subscribe For Access

GitHub Link :

https://github.com/sysdr/auto-testing-manual-p/tree/main/lesson59/lesson_59_workspace
User's avatar

Continue reading this post for free, courtesy of HandsOn Automation Bootcamp.

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