Bird
0
0

How do you correctly assign a priority of 2 to a TestNG test method?

easy📝 Syntax Q3 of 15
Selenium Java - TestNG Integration
How do you correctly assign a priority of 2 to a TestNG test method?
A@Test(priority = 2)
B@Test(order = 2)
C@Test(dependsOn = 2)
D@Test(sequence = 2)
Step-by-Step Solution
Solution:
  1. Step 1: Recall TestNG priority syntax

    The correct attribute to set priority is priority inside the @Test annotation.
  2. Step 2: Verify syntax

    The syntax is @Test(priority = 2).
  3. Final Answer:

    @Test(priority = 2) -> Option A
  4. Quick Check:

    Priority uses priority attribute [OK]
Quick Trick: Use priority attribute inside @Test [OK]
Common Mistakes:
  • Using order instead of priority
  • Using dependsOn incorrectly for priority
  • Using sequence attribute which does not exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes