Extent Report: Name of output file does not change even when defined

Viewed 521

Im not able to change the name of the outputfile from the extent reports. It does always create the report file called index.html.

In my code, i want to display the name + date/time.html

Here is the codeline for the path definition:

        private const string ExtentReportPath = @".\ExtentReports\";
        [OneTimeSetUp]
        public void ExtentStart()
        {
            ExtentHtmlReporter htmlreporter = new ExtentHtmlReporter(ExtentReportPath + "UnlockInstruction_Test" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".html");
            extent = new ExtentReports();
            extent.AttachReporter(htmlreporter);
        }

        [OneTimeTearDown]
        public void ExtentClose()
        {
            extent.Flush();
        }

First solution ive found is:

I changed ExtentHtmlReporter to ExtentV3HtmlReporter.

But after using ExtentV3HtmlReporter, VS is displaying a warning which says, that this method is obsolete and wont be supported in the future.. so still waiting for a up to date solution.

0 Answers
Related