extentreports-csharp icon indicating copy to clipboard operation
extentreports-csharp copied to clipboard

Not able to see the file index.html in specified folder path.

Open quldude opened this issue 5 years ago • 3 comments

We are using C# Extent ver 4.1.0 and not able to see the file index.html in specified folder path (instead shows up where my calling application folder is like /bin/Debug). Here is our code:

// AutoParms.FilePaths.ResultsDirectory = Path.Combine(System.AppContext.BaseDirectory, "Results");

if (!Directory.Exists(AutoParms.FilePaths.ResultsDirectory))
                Directory.CreateDirectory(AutoParms.FilePaths.ResultsDirectory);

            var htmlReporter = new ExtentHtmlReporter(Path.Combine(AutoParms.FilePaths.ResultsDirectory));
            htmlReporter.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            ExtentReports instance = new ExtentReports();
            instance.AttachReporter(htmlReporter);
instance.Flush();

Any idea why?

quldude avatar Sep 28 '20 01:09 quldude

Same here. here is how i do ;

string path = AppDomain.CurrentDomain.BaseDirectory.Replace(@"\Fixtures\bin\Debug", ""); path = path + @"Extras\last_report\index.html"; reporter = new ExtentHtmlReporter(path);

Not the best way but it works.

Overclock303 avatar Sep 28 '20 08:09 Overclock303

Thanks @Overclock303 ! Your workaround works for me as well. It looks like there is a bug that always seem to save the html in the directory before the current one.

quldude avatar Sep 28 '20 14:09 quldude

@quldude You need '/' After Result

AutoParms.FilePaths.ResultsDirectory = Path.Combine(System.AppContext.BaseDirectory, "Results/");

namilkimfree avatar Feb 26 '21 16:02 namilkimfree