Bird
0
0

Given these test methods:

medium📝 Predict Output Q4 of 15
Selenium Java - TestNG Integration
Given these test methods:
@Test(groups = {"fast"})
public void testA() {}
@Test(groups = {"slow"})
public void testB() {}
@Test(groups = {"fast", "regression"})
public void testC() {}

Which tests run if you execute only the 'fast' group?
AtestB only
BtestA only
CtestA and testC
DtestB and testC
Step-by-Step Solution
Solution:
  1. Step 1: Identify tests with 'fast' group

    testA has 'fast', testC has 'fast' and 'regression'. testB has 'slow' only.
  2. Step 2: Select tests matching 'fast'

    testA and testC belong to 'fast' group and will run.
  3. Final Answer:

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

    Tests in 'fast' group = testA, testC [OK]
Quick Trick: Tests with group included run when that group is selected [OK]
Common Mistakes:
  • Including tests from other groups
  • Ignoring tests with multiple groups
  • Selecting tests not in the chosen group

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes