0

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

asked May 1, 2018 at 8:08
2

2 Answers 2

0

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");
extent.endTest(test);
extent.flush();
demouser123
3,5325 gold badges30 silver badges41 bronze badges
answered May 2, 2018 at 12:03
0

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

answered May 3, 2018 at 5:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.