【问题标题】:How can I override testcases in same report using extend report如何使用范围报告覆盖同一报告中的测试用例
【发布时间】:2019-10-11 14:30:46
【问题描述】:

如何在同一份报告中覆盖多个执行的测试用例?就像我多次运行失败的测试用例一样,它应该覆盖同一个文件而不会丢失其他记录。

就我而言,它会从文件中删除所有旧记录并添加新记录。

string path1 = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug", "");
        string path = path1 + "Report\\index.html";
        ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(path);
        htmlReporter.Configuration().Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Standard;
        extent = new ExtentReports();
        extent.AttachReporter(htmlReporter);

【问题讨论】:

    标签: selenium automation extentreports selenium-extent-report


    【解决方案1】:

    附加到报告 ExtentHtmlReporter 和 ExtentXReporter 允许将测试信息附加到现有报告中。

    附加到 HtmlReporter

    htmlReporter.setAppendExisting(true);
    

    附加到 ExtentXReporter 如果要根据 ObjectId 附加到现有报告,请使用:

    extentXReporter.setAppendExisting(true, reportId);
    

    或:

    extentxReporter.config().setReportObjectId(ObjectId id);
    extentxReporter.config().setReportObjectId(String id);
    

    如果您想根据报告名称附加到现有报告,请使用:

    extentxReporter.setAppendExisting(true);
    

    注意:如果您有多个同名报告,则追加将应用于与报告名称匹配的上次运行的报告。

    【讨论】:

    • 谢谢,但这些东西不适用于 v 3.1.1
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-29
    • 2019-03-07
    相关资源
    最近更新 更多