Bird
0
0

You want to run tests in a specific order but also skip some tests if a critical test fails. Which TestNG features should you combine?

hard📝 Application Q8 of 15
Selenium Java - TestNG Integration
You want to run tests in a specific order but also skip some tests if a critical test fails. Which TestNG features should you combine?
Apriority and dependsOnMethods
Bgroups and timeout
CinvocationCount and enabled
DalwaysRun and dataProvider
Step-by-Step Solution
Solution:
  1. Step 1: Identify features for ordering and dependency

    Use priority to set order and dependsOnMethods to skip tests if dependencies fail.
  2. Step 2: Exclude unrelated features

    groups, timeout, invocationCount, enabled, alwaysRun, and dataProvider do not control order and skip based on failure.
  3. Final Answer:

    priority and dependsOnMethods -> Option A
  4. Quick Check:

    Order + skip on failure = priority + dependsOnMethods A [OK]
Quick Trick: Combine priority and dependsOnMethods for order and skip [OK]
Common Mistakes:
  • Using groups for execution order
  • Confusing timeout with skipping tests
  • Misusing alwaysRun for skipping logic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes