Bird
Raised Fist0

A test script fails because it uses an outdated locator for a button. How should this be fixed?

medium📝 Debug Q7 of Q15
Testing Fundamentals - Why Software Testing Matters
A test script fails because it uses an outdated locator for a button. How should this be fixed?
ARemove the test script
BUpdate the locator to match the current button attributes
CIgnore the failure and continue testing
DChange the button's code to match the old locator
Step-by-Step Solution
Solution:
  1. Step 1: Identify cause of failure

    The test script fails because the locator does not match the current UI element.
  2. Step 2: Fix the locator

    Updating the locator to the current button attributes will fix the test script.
  3. Final Answer:

    Update the locator to match the current button attributes -> Option B
  4. Quick Check:

    Locator must match UI elements [OK]
Quick Trick: Keep locators updated with UI changes [OK]
Common Mistakes:
MISTAKES
  • Ignoring locator updates
  • Deleting tests unnecessarily
  • Changing application code to fit tests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes