Bird
0
0

Given the following TestNG test methods, which tests will run if you execute only the "fast" group?

medium📝 Predict Output Q13 of 15
Selenium Java - TestNG Integration
Given the following TestNG test methods, which tests will run if you execute only the "fast" group?
@Test(groups = {"fast"})
public void testA() {}

@Test(groups = {"slow"})
public void testB() {}

@Test(groups = {"fast", "regression"})
public void testC() {}
AtestA only
BtestB only
CtestA and testC
DtestB and testC
Step-by-Step Solution
Solution:
  1. Step 1: Identify tests with group "fast"

    testA has group "fast"; testC has groups "fast" and "regression"; testB has "slow" only.
  2. Step 2: Determine which tests run when "fast" group is executed

    Only tests assigned to "fast" group run, so testA and testC run; testB does not.
  3. Final Answer:

    testA and testC -> Option C
  4. Quick Check:

    Run group "fast" = testA, testC [OK]
Quick Trick: Run group runs all tests tagged with it [OK]
Common Mistakes:
  • Running tests from other groups
  • Ignoring tests with multiple groups
  • Assuming only single-group tests run

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes