Bird
0
0

Find the issue in this TestNG XML for parallel execution:

medium📝 Debug Q7 of 15
Selenium Java - TestNG Integration
Find the issue in this TestNG XML for parallel execution:
<suite name="Suite" parallel="tests" thread-count="3">
  <test name="Test1" parallel="methods">
    <classes>
      <class name="TestClass1"/>
    </classes>
  </test>
  <test name="Test2">
    <classes>
      <class name="TestClass2"/>
    </classes>
  </test>
</suite>
Aparallel="methods" is invalid inside test tag
Bparallel attribute inside test overrides suite parallel
Cthread-count must be set inside each test tag
DMissing thread-count attribute in test tags
Step-by-Step Solution
Solution:
  1. Step 1: Understand parallel attribute inheritance

    parallel attribute inside a <test> overrides the suite-level parallel setting for that test.
  2. Step 2: Analyze the effect of overriding

    Test1 runs methods in parallel, while Test2 runs classes in parallel as per suite setting, causing inconsistent parallelism.
  3. Final Answer:

    parallel attribute inside test overrides suite parallel -> Option B
  4. Quick Check:

    Test-level parallel overrides suite-level parallel [OK]
Quick Trick: Test-level parallel overrides suite-level parallel [OK]
Common Mistakes:
  • Assuming thread-count must be inside test tags
  • Believing parallel="methods" is invalid inside test
  • Ignoring override behavior of parallel attribute

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes