I have recently started rest assured to automate APIs. My current framework folder structure has an ApiTestCases class in a folder under src/test/java. I have a testNG suite xml to run the tests. How do I implement extent reports with this structure? I have tried to look online but its confusing. Please tell step by step detailed instructions. Also, do I need to create a Utility folder under src/test/java?

Please help me get started with this! Thus far I have added the extent report dependency version 3.0 in my POM.xml


2 Answers 2


The below sample script worked for me in creating Extent reports and make changes according to your testcases for rest assured api framework.

//For creating html

    ExtentReports extent = new ExtentReports("./report/result.html",false);

//For creating each test
ExtentTest test = extent.startTest("Your testcase name","short description of your testcase");

test.assignCategory("Type of testing");//For example Smoke or sanity or regression

test.assignAuthor("Name of the author");//Author name who created the testcase

//For testcase status along with description
test.log(LogStatus.PASS,"The value entered successfully");


If you have testbase in your project you can implement extent report basic methods in that class like below

enter image description here

Then call that method in your test class

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.