Skip to main content

Cucumber Extent Report: Customize Report Folder Name

Every time you generate a Cucumber report, it gets generated in the same folder and overwrites the existing report. You can customize the report folder name with date and time details to avoid this. 

For that, add the following two lines in your extent properties file.

basefolder.name=test-output/reports
basefolder.datetimepattern=d-MMM-YY-HH-mm-ss

Here base folder is where spark, pdf reports and screenshots will be stored. Date pattern will be added after the base folder name.

Make sure that date patten is valid date-time format. You can check all the different Formatter patterns here (Oracle Class DateFormatter).

extent.properties with other report configuration

extent.reporter.spark.start=true
extent.reporter.spark.out=SparkReport/MySparkReport.html

screenshot.dir=screenshots
screenshot.rel.path=../screenshots/

extent.reporter.pdf.start=true
extent.reporter.pdf.out=PDFReport/ExtentReport.pdf

basefolder.name=test-output/reports
basefolder.datetimepattern=d-MMM-YY-HH-mm-ss

Output folder after execution of report 

Cucumber Extent Report: Customize Report Folder Name

In above screenshot you can see our base folder was test-output/reports , date time and seconds are postfixed after report folder name. PDF Report and Spark report and screenshots folders are created inside report folder.

Submitted by tgoswami on February 20, 2022

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.