Bird
0
0

Find the issue in this testng.xml snippet:

medium📝 Debug Q7 of 15
Selenium Java - TestNG Integration
Find the issue in this testng.xml snippet:
<suite name="Suite1">
  <test name="Test1">
    <classes>
      <class name="tests.LoginTest" />
      <class name="tests.PaymentTest" />
    </classes>
  </test>
  <test name="Test1">
    <classes>
      <class name="tests.ProfileTest" />
    </classes>
  </test>
</suite>
AMultiple classes inside one test are not allowed
BDuplicate test names cause conflicts
CMissing parallel attribute in suite tag
DClass names must be unique across tests
Step-by-Step Solution
Solution:
  1. Step 1: Check test name uniqueness

    Each <test> tag should have a unique name to avoid confusion.
  2. Step 2: Identify duplicate names

    Both tests are named "Test1", which can cause conflicts in reports and execution.
  3. Final Answer:

    Duplicate test names cause conflicts -> Option B
  4. Quick Check:

    Test names must be unique [OK]
Quick Trick: Give unique names to each in testng.xml [OK]
Common Mistakes:
MISTAKES
  • Using same test name multiple times
  • Assuming multiple classes per test are invalid
  • Ignoring naming conventions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes