Bird
0
0

Why is it important to have unique name attributes for <test> tags in testng.xml?

hard📝 Conceptual Q10 of 15
Selenium Java - TestNG Integration
Why is it important to have unique name attributes for <test> tags in testng.xml?
ATo enable parallel execution of tests
BBecause TestNG requires names to match class names
CTo avoid conflicts in test reports and execution order
DBecause duplicate names cause compilation errors
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of test names

    Test names identify tests in reports and logs, helping distinguish them.
  2. Step 2: Consequences of duplicate names

    Duplicate names cause confusion in reports and may affect execution clarity, but not compilation errors.
  3. Final Answer:

    To avoid conflicts in test reports and execution order -> Option C
  4. Quick Check:

    Unique test names prevent report conflicts [OK]
Quick Trick: Unique test names prevent report confusion [OK]
Common Mistakes:
  • Thinking names must match class names
  • Assuming duplicates cause compile errors
  • Believing unique names enable parallelism

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes