Bird
0
0

Given this TestNG XML snippet, how many tests will run in parallel?

medium📝 Predict Output Q13 of 15
Selenium Java - TestNG Integration
Given this TestNG XML snippet, how many tests will run in parallel?
<suite name="Suite" parallel="tests" thread-count="3">
  <test name="Test1"></test>
  <test name="Test2"></test>
  <test name="Test3"></test>
  <test name="Test4"></test>
</suite>
AAll 4 tests run in parallel
B3 tests run in parallel, 1 waits
COnly 1 test runs at a time
D2 tests run in parallel, 2 wait
Step-by-Step Solution
Solution:
  1. Step 1: Understand thread-count and parallel attribute

    parallel="tests" means tests run in parallel. thread-count="3" limits max parallel threads to 3.
  2. Step 2: Apply thread-count to number of tests

    There are 4 tests but only 3 threads, so 3 tests run simultaneously and 1 waits.
  3. Final Answer:

    3 tests run in parallel, 1 waits -> Option B
  4. Quick Check:

    thread-count limits parallel tests to 3 [OK]
Quick Trick: thread-count limits max parallel tests running [OK]
Common Mistakes:
  • Assuming all tests run parallel ignoring thread-count
  • Confusing parallel="tests" with parallel="methods"
  • Ignoring that thread-count caps parallelism

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes