Bird
0
0

In TestNG, which annotation attribute ensures that a test method runs only after another specified test method completes successfully?

easy📝 Conceptual Q2 of 15
Selenium Java - TestNG Integration
In TestNG, which annotation attribute ensures that a test method runs only after another specified test method completes successfully?
AalwaysRun
Bpriority
CdependsOnMethods
Denabled
Step-by-Step Solution
Solution:
  1. Step 1: Identify dependency attribute

    TestNG uses dependsOnMethods to specify dependencies between tests.
  2. Step 2: Understand behavior

    This attribute ensures the dependent test runs only if the specified test passes.
  3. Final Answer:

    dependsOnMethods -> Option C
  4. Quick Check:

    Dependency uses dependsOnMethods [OK]
Quick Trick: Use dependsOnMethods for test dependencies [OK]
Common Mistakes:
MISTAKES
  • Confusing priority with dependencies
  • Using alwaysRun incorrectly
  • Assuming enabled controls execution order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes