Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

[HelpNeeded]Unable to Append Child Tests in for loog in version 2.0 #1105

Open
rajikuchana opened this issue Aug 16, 2018 · 1 comment
Open

Comments

@rajikuchana
Copy link

Summary

1.Running API Tests using Excel Data for 4 rows
2.Created Parent Test before for loop
3.Created Child Test under for loop to print Test Case Name in report
4.After appending child Test to parent displaying 4 records in report and each record having 1 test case name and 2nd row having 2 records,3rd row having 3 records,4th row having 4 records.
Please help how to resolve this problem and my code is .

Expected Behavior

Current Behavior

Sample

pubcli Class{

![extent child tsts](https://user-images.githubusercontent.com/25505499/44206219-bd5cf980-a176-11e8-8435-e1478e0c46d7.png)
![extent child tsts](https://user-images.githubusercontent.com/25505499/44206234-ca79e880-a176-11e8-83f6-c426a754e8c0.png)

@Test
public void testCustomerCreation(){

parentTest = extent.startTest("Create Customer API Test");

for(int i=1,i<=4;i++){

String testCaseName = ReadWriteExcel.getCellValue(xl, sheet, i,1);

test = extent.startTest(testCaseName);			
test.log(LogStatus.PASS, "Customer Creation Test is started");	

//Some If Condtions here

if(response_Mes.equals("SUCCESS")){

test.log(LogStatus.PASS,response_Mes );	

}else{
test.log(LogStatus.FAIL,response_Mes );	
	}

parentTest.appendChild(test);
			extent.endTest(parentTest);
			test.getRunStatus();

	}

}


}

Environment Details

  • Extent report Version used:2.04
  • Operating System and version:Windows 7
  • JDK Version:1.8

Screenshots

@foursyth
Copy link

Version 2 is no longer supported. Please upgrade to version 3 out the upcoming version 4 (next month).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants