Bird
0
0

Identify the error in this testng.xml snippet:

medium📝 Debug Q6 of 15
Selenium Java - TestNG Integration
Identify the error in this testng.xml snippet:
<suite name="Suite1" parallel="methods" thread-count="2">
  <test name="Test1">
    <class name="tests.LoginTest" />
  </test>
</suite>
AMissing <test> tag inside <suite>
BInvalid attribute thread-count in <suite> tag
Cparallel attribute cannot be set to methods
DMissing <classes> tag wrapping the <class> tag
Step-by-Step Solution
Solution:
  1. Step 1: Check required structure inside <test>

    Inside a <test>, classes must be wrapped inside a <classes> tag.
  2. Step 2: Validate given snippet

    The snippet has <class> directly inside <test> without <classes>.
  3. Final Answer:

    Missing <classes> tag wrapping the <class> tag -> Option D
  4. Quick Check:

    Classes must be inside <classes> [OK]
Quick Trick: Always wrap inside in testng.xml [OK]
Common Mistakes:
MISTAKES
  • Omitting tag
  • Misusing thread-count attribute
  • Incorrect parallel attribute values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes