Why ExtentReport NOT displaying current Date time to html file ...instead why it is taking index.html name.
WHAT'S WRONG IN MY CODE
public static ExtentReports getInstance()
{
if (extent == null)
{
string reportFile = DateTime.Now.ToString().Replace("-", "_").Replace(":", "_").Replace(" ", "_") + ".html";
htmlReporter = new ExtentHtmlReporter(@"C:\BNSF_Automation\Extent_Reports\" + reportFile);
extent = new ExtentReports();
extent.AttachReporter(htmlReporter);
extent.AddSystemInfo("OS", "Windows");
extent.AddSystemInfo("Host Name", "vrhaldan");
extent.AddSystemInfo("Environment", "QA");
extent.AddSystemInfo("UserName", "vrhaldan");
Console.WriteLine(DateTime.Now.ToString());
Console.WriteLine(DateTime.Now.ToString().Replace("-", "_").Replace(":", "_").Replace(" ", "_"));
htmlReporter.LoadConfig(@"C:\Users\vrhaldan\documents\visual studio 2015\Projects\Sample_Extent_Report\Sample_Extent_Report\extent-config.xml");
}
return extent;
}
Instructor
gunjan Replied on 23/03/2019
Please share the zip file of the complete code.
Hello,
I am also having the same issue. My code is exactly same as above. Please help.
Thanks,
Anuja