0
0
Selenium Javatesting~20 mins

TestNG default reports in Selenium Java - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
TestNG Report Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
TestNG Default Report: Passed Tests Count
Given the following TestNG test class, what will be the count of passed tests shown in the default TestNG report after execution?
Selenium Java
import org.testng.annotations.Test;

public class SampleTest {
    @Test
    public void testA() {
        assert true;
    }

    @Test
    public void testB() {
        assert true;
    }

    @Test
    public void testC() {
        assert false;
    }
}
A3
B0
C2
D1
Attempts:
2 left
💡 Hint
Remember that tests with failed assertions are not counted as passed.
assertion
intermediate
2:00remaining
Assertion in TestNG Default Report for Skipped Tests
If a test method is annotated with @Test and depends on another test that fails, what will the default TestNG report show for the dependent test?
Selenium Java
import org.testng.annotations.Test;

public class DependencyTest {
    @Test
    public void test1() {
        assert false;
    }

    @Test(dependsOnMethods = {"test1"})
    public void test2() {
        assert true;
    }
}
Atest2 is marked as passed in the report
Btest2 is marked as skipped in the report
Ctest2 is marked as failed in the report
Dtest2 is not shown in the report
Attempts:
2 left
💡 Hint
Think about what happens when a dependency test fails in TestNG.
🔧 Debug
advanced
2:00remaining
Debugging Missing Test Results in TestNG Default Report
A tester notices that some test methods are not appearing in the TestNG default report after execution. Which of the following is the most likely cause?
ATest methods have assertions that always pass
BTest methods throw exceptions but are still marked as @Test
CTest methods are private instead of public
DTest methods are missing the @Test annotation
Attempts:
2 left
💡 Hint
TestNG only recognizes methods with a specific annotation as tests.
🧠 Conceptual
advanced
2:00remaining
Understanding TestNG Default Report Structure
Which section is NOT part of the default TestNG HTML report generated after test execution?
ACode coverage percentage for tested classes
BDetailed stack trace for failed tests
CSummary of passed, failed, and skipped tests
DTest execution time for each test method
Attempts:
2 left
💡 Hint
Think about what TestNG reports by default without extra tools.
framework
expert
3:00remaining
Customizing TestNG Default Reports
Which of the following is the correct way to add custom logging information to the TestNG default report?
AImplement ITestListener and override onTestSuccess to add logs
BModify the testng.xml file to include custom log tags
CAdd System.out.println statements inside test methods
DUse @Listeners annotation to disable default reports and write logs
Attempts:
2 left
💡 Hint
TestNG allows listeners to hook into test events for custom behavior.