Bird
0
0

Which of the following is the correct syntax to enable parallel execution of test methods in TestNG XML?

easy📝 Conceptual Q3 of 15
Selenium Java - TestNG Integration
Which of the following is the correct syntax to enable parallel execution of test methods in TestNG XML?
A<suite name="Suite" parallel="tests" threads="3">
B<suite name="Suite" parallel="methods" thread-count="3">
C<suite name="Suite" parallel="classes" threadCount="3">
D<suite name="Suite" parallel="methods" maxThreads="3">
Step-by-Step Solution
Solution:
  1. Step 1: Check correct attribute names and values

    The correct attributes are parallel and thread-count (with hyphen).
  2. Step 2: Validate syntax

    uses parallel="methods" and thread-count="3", which is correct syntax.
  3. Final Answer:

    <suite name="Suite" parallel="methods" thread-count="3"> -> Option B
  4. Quick Check:

    parallel and thread-count are correct attribute names [OK]
Quick Trick: Use parallel and thread-count exactly as attribute names [OK]
Common Mistakes:
MISTAKES
  • Using threads instead of thread-count
  • Using camelCase like threadCount instead of thread-count
  • Mixing parallel values incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes