Bird
0
0

A tester writes automated tests that check login functionality. Later, the login page UI changes, breaking the tests. How can the tester improve test design to reduce such breakage?

hard📝 Application Q9 of 15
Testing Fundamentals - Why Software Testing Matters
A tester writes automated tests that check login functionality. Later, the login page UI changes, breaking the tests. How can the tester improve test design to reduce such breakage?
ATest only manually to avoid automation issues.
BUse stable locators like IDs or data attributes instead of text labels.
CAvoid updating tests after UI changes.
DHardcode all element paths to ensure exact matches.
Step-by-Step Solution
Solution:
  1. Step 1: Understand cause of test breakage

    Tests break when locators rely on unstable UI elements like text labels.
  2. Step 2: Choose better locator strategy

    Using stable attributes like IDs or data-* attributes reduces breakage.
  3. Final Answer:

    Use stable locators like IDs or data attributes instead of text labels. -> Option B
  4. Quick Check:

    Stable locators = fewer test breaks [OK]
Quick Trick: Use stable element locators in tests [OK]
Common Mistakes:
  • Hardcoding fragile locators
  • Ignoring test maintenance
  • Avoiding automation due to UI changes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes