Bird
0
0

Which configuration is best?

hard📝 framework Q9 of 15
Selenium Java - TestNG Integration
You have a suite with multiple tests, each containing multiple classes and methods. You want to maximize parallelism but ensure no two methods from the same class run at the same time. Which configuration is best?
A<suite name="Suite" parallel="suites" thread-count="10">
B<suite name="Suite" parallel="classes" thread-count="10">
C<suite name="Suite" parallel="methods" thread-count="10">
D<suite name="Suite" parallel="tests" thread-count="10">
Step-by-Step Solution
Solution:
  1. Step 1: Understand constraint on methods from same class

    Methods from the same class must not run simultaneously, so methods inside a class must run sequentially.
  2. Step 2: Analyze parallel="tests" effect

    parallel="tests" runs tests in parallel, but inside each test, classes and methods run sequentially, preserving method order within classes.
  3. Final Answer:

    <suite name="Suite" parallel="tests" thread-count="10"> -> Option D
  4. Quick Check:

    parallel="tests" ensures methods in same class run sequentially [OK]
Quick Trick: parallel="tests" keeps methods in class sequential, maximizes test parallelism [OK]
Common Mistakes:
  • Using parallel="methods" causing methods in same class parallel
  • Using parallel="classes" allowing methods parallel in same class
  • Confusing suites with tests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes