Bird
0
0

What will happen if you run TestNG with this XML snippet?

medium📝 Predict Output Q5 of 15
Selenium Java - TestNG Integration
What will happen if you run TestNG with this XML snippet?
<groups>
  <run>
    <exclude name="smoke"/>
  </run>
</groups>

Assuming some tests belong to 'smoke' group and others do not.
AAll tests except those in 'smoke' group will run
BOnly 'smoke' group tests will run
CNo tests will run
DAll tests will run regardless of groups
Step-by-Step Solution
Solution:
  1. Step 1: Understand exclude in groups

    The exclude tag removes tests in the specified group from running.
  2. Step 2: Apply exclude to 'smoke'

    Tests in 'smoke' group are skipped; others run normally.
  3. Final Answer:

    All tests except those in 'smoke' group will run -> Option A
  4. Quick Check:

    Exclude group = skip those tests [OK]
Quick Trick: Exclude skips tests in that group during run [OK]
Common Mistakes:
  • Thinking exclude runs only that group
  • Assuming exclude stops all tests
  • Confusing exclude with include

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes