Error while trying to generate html report | Selenium Webdriver Tutorial with c# |Selenium C# training
10% July Month Discount Avail now

Selenium C# Training Forum

Error while trying to generate html report

F
Franz Kriesten Post on 01/07/2019

Hello,

Could you please help me solve his issue

 

Message: System.IO.FileNotFoundException : Could not load file or assembly 'RazorEngine, Version=3.9.0.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a' or one of its dependencies. The system cannot find the file specified.

F
Franz Kriesten Reply on 01/07/2019

For reference,

 

public class ExtentManager
{
public static ExtentHtmlReporter htmlReporter;

private static ExtentReports extent;
private ExtentManager()
{

}
public static ExtentReports getInstance()
{
if(extent == null)
{
String reportFile= DateTime.Now.ToString().Replace("/", "_").Replace(":", "_").Replace(" ", "_") + ".html";
htmlReporter = new ExtentHtmlReporter(@"D:\Selenium_files\Reports\" + reportFile);
extent = new ExtentReports();
extent.AttachReporter(htmlReporter);
extent.AddSystemInfo("OS", "Windows");
extent.AddSystemInfo("Host Name", "AiBATROS");
extent.AddSystemInfo("Environment", "QA");

string filePath = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory);
filePath = Directory.GetParent(Directory.GetParent(filePath).FullName).FullName;
htmlReporter.LoadConfig(filePath + "\\extent-config.xml");

}
return extent;
}
}

F
Franz Kriesten Reply on 01/07/2019

Hello,

I solved the issue by downloading Extent Reports version 4