Bird
0
0

Which of the following is the correct syntax to run only the 'regression' group using TestNG XML?

easy📝 Syntax Q3 of 15
Selenium Java - TestNG Integration
Which of the following is the correct syntax to run only the 'regression' group using TestNG XML?
A<groups><run><include name="regression"/></run></groups>
B<groups><exclude name="regression"/></groups>
C<test name="regression"/>
D<suite name="regression"/>
Step-by-Step Solution
Solution:
  1. Step 1: Understand TestNG XML group syntax

    To run specific groups, use <groups><run><include name="groupName"/></run></groups>.
  2. Step 2: Identify correct XML snippet

    <groups><run><include name="regression"/></run></groups> matches the correct syntax to include the 'regression' group.
  3. Final Answer:

    <groups><run><include name="regression"/></run></groups> -> Option A
  4. Quick Check:

    Include groups in XML = <include name> [OK]
Quick Trick: Use inside to select groups in XML [OK]
Common Mistakes:
  • Using to run groups
  • Confusing or tags for groups
  • Missing tag inside

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes