extentreports-java icon indicating copy to clipboard operation
extentreports-java copied to clipboard

Need help in grouping my test case results based on categories.

Open ghost opened this issue 8 years ago • 2 comments

Hi,

I am having a requirement where i need to represent my tests in categories, Let say i have 10 tests which falls under 2 categories. I want to so these two categories as main headers and then when user clicks this category it should show the 5 tests under it.

Category1: Test1......Test5 Category2 Test6........Test10.

Can you please provide these pointers how we can achieve using C# .

Thanks Chaitanya

ghost avatar Jan 19 '18 19:01 ghost

As far as I know, you need to use the parent-child concept here to satisfy your requirement.

ExtentTest parent = extent.startTest("Parent");

ExtentTest child1 = extent.startTest("Child 1");
child1.log(LogStatus.INFO, "Info");

ExtentTest child2 = extent.startTest("Child 2");
child2.log(LogStatus.PASS, "Pass");

parent
    .appendChild(child1)
    .appendChild(child2);
    
extent.endTest(parent);


here parent will be your category1, category 2 and child will be individual tests within that category.

source: extentreports documentation

I hope this will help.

dipesh17 avatar Feb 20 '18 13:02 dipesh17

I am not getting parent.appendChild itself

bobbyneelam avatar Feb 21 '18 04:02 bobbyneelam