Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Tests and Steps in testng extent report

I'm confused in difference between Tests and Steps in testng extent report.

I have 2 test cases as 1 pass and 1 fail. In extent report under Test: 1 test(s) passed 1 test(s) failed, 0 others and under Steps: 1 step(s) passed 2 step(s) failed, 0 others

So would anyone clarify what is the difference between both ?

Attaching code snippet and testng extent report

    @Test
    public void demoTestPass()
    {
        test = extent.createTest("demoTestPass", "This test will demonstrate the PASS test case");
        Assert.assertTrue(true);
    }


    @Test
    public void demoTestFail()
    {
        test = extent.createTest("demoTestFail", "This test will demonstrate the FAIL test case");
        Assert.assertEquals("Hi", "Hello");
    }

Please click for Extent report here.

Any clarification would be much appreciated.

like image 607
Rabikatha Avatar asked Apr 30 '18 08:04

Rabikatha


People also ask

What is the difference between TestNG report and extent report?

Extent Reports offer several advantages when compared to the built-in reports that are generated through JUnit and TestNG such as pie chart representation, test stepwise report generation, adding screenshots etc., at every test step and a presentable user interface that can be shared with all stakeholders of the ...

What are the different test status available in extent?

We shall create test cases that end in three different statuses like Pass, Fail and Skip. To create a test, we can use createTest(test_name,test_description) using ExtentReports class.

What is extent report in TestNG?

What is the Extent Report? Extent Report is an open-source reporting library used to create visually attractive reports for Selenium tests using JUnit and TestNG. Extent reports produce HTML-based documents that offer several advantages like pie charts, graphs, screenshots addition, and test summary.


2 Answers

Difference Between Tests and Steps in extentReport:

Tests defines: Total test section which you have created in your Report: With the syntax like : extentReport.createTest("name of section");

Steps defines : Total number of log which you have generated in Script, With the syntax like : testlog.info() OR testlog.pass() OR testlog.fail() where testlog is object of ExtentTest class

Example: Image of Report

In this report, there are 3 section which has been created and its showing as Tests. And Steps defines numbers of logs which has been passed in those Test.

Your case :

Test: 1 test(s) passed 1 test(s) failed, 0 others and under Steps: 1 step(s) passed 2 step(s) failed, 0 others

Test include 1 pass and 1 fail, because of its get failure in Steps. Your Steps include 1 pass and 2 fails and its reflected on Test.

like image 123
Ishita Shah Avatar answered Sep 28 '22 02:09

Ishita Shah


Test(startTest("test name")) is something that is used to create a new test in extent reports.

Steps denotes that how many messages (test. Pass("pass message"), test. Fail ("fail message), test. Info ("info message")) you've logged to reports.

Consider you've two test methods and each test method has 1pass and 1 info messages.

So, in the extent reports, it'll show like 2 tests, total 4 steps. 2 pass steps and 2 info steps

like image 24
Magesh Avatar answered Sep 28 '22 02:09

Magesh