Bird
0
0

You want to run multiple test classes in parallel, but each class has multiple test methods that must run sequentially. Which TestNG XML configuration achieves this?

hard📝 framework Q8 of 15
Selenium Java - TestNG Integration
You want to run multiple test classes in parallel, but each class has multiple test methods that must run sequentially. Which TestNG XML configuration achieves this?
A<suite name="Suite" parallel="methods" thread-count="5">
B<suite name="Suite" parallel="tests" thread-count="5">
C<suite name="Suite" parallel="classes" thread-count="5">
D<suite name="Suite" parallel="suites" thread-count="5">
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirement for classes parallel, methods sequential

    Parallel at class level runs classes simultaneously, but methods inside each class run one by one.
  2. Step 2: Match with parallel attribute values

    parallel="classes" runs classes in parallel, which fits the requirement.
  3. Final Answer:

    <suite name="Suite" parallel="classes" thread-count="5"> -> Option C
  4. Quick Check:

    parallel="classes" = classes parallel, methods sequential [OK]
Quick Trick: Use parallel="classes" for classes parallel, methods sequential [OK]
Common Mistakes:
  • Using parallel="methods" which runs methods parallel
  • Using parallel="tests" which runs tests parallel
  • Confusing suites with classes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes