Extent Reports generating two HTML Reports

风格不统一 提交于 2020-01-25 06:52:08

问题


so I've worked with Extent Reports several times in the past versions (Since 2.0 upwards) and I was able to generate a single html report after tests were executed, same happened on version 3.0 until version 4.0 which generates dashboard.html and index.html.

From a Business perspective it is a bit weird having two report files... am I missing something on my code, or is that the new Standard of the Reporting stuff?

Single report file is generated on both versions 2.X and 3.X of ExtentReports For both Java/C#

Attached you can see the actual code I'm using on version 3.1 to get a single file report

            _extent = new ExtentReports();
            var dir = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug", "");
            DirectoryInfo di = Directory.CreateDirectory(dir + "\\Test_Execution_Reports");
            var htmlReporter = new ExtentHtmlReporter(@"C:\testR\AutoReport.html");
            htmlReporter.LoadConfig("C:\\testR\\ReportConfig.xml");
            _extent.AddSystemInfo("Environment", "Test Report");
            _extent.AddSystemInfo("User Name", "Test User");
            _extent.AttachReporter(htmlReporter);

回答1:


Following resolved the issue.

I was previously using

ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(reportPath);

in v4 I am using the following (basically this creates v3 style report on v4)

ExtentV3HtmlReporter htmlReporter = new ExtentV3HtmlReporter(reportPath);

so please replace ExtentHtmlReporter with ExtentV3HtmlReporter

var htmlReporter = new ExtentV3HtmlReporter (@"C:\testR\AutoReport.html");


来源:https://stackoverflow.com/questions/57097328/extent-reports-generating-two-html-reports

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!