extentreports-csharp
extentreports-csharp copied to clipboard
Not able to see the file index.html in specified folder path.
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?
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.
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 You need '/' After Result
AutoParms.FilePaths.ResultsDirectory = Path.Combine(System.AppContext.BaseDirectory, "Results/");