当前位置: 首页 > 知识库问答 >
问题:

报告与现有selenium框架的集成程度

秦建元
2023-03-14

我有一个基于模块的selenium java框架。它是现有的和古老的。我不知道如何将Exent报告集成到它中。它有诱惑力报告,输出是xml格式的。人们想要可共享的html报告。请帮忙。

共有1个答案

淳于健
2023-03-14

将硒与范围报告集成:步骤 1 创建空白 html

ExtentHtmlReporter reporter=new ExtentHtmlReporter("HTML_Report_"+timeStamp+".html");

步骤2:创建范围报告对象

ExtentReports extent = new ExtentReports();

步骤 3:将范围报告对象附加到 html

   extent.attachReporter(reporter);

步骤4:

testlog= extent.createTest("Report String");

Step5:调用这些函数来添加步骤和屏幕截图

    testlog.log(Status.PASS,"string description")

第6步:

extent.flush()

为此报告创建单独的类,例如:

public class Report {
    
     
     
    public void setup()
    {
        String timeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());//time stamp
        
        ExtentHtmlReporter reporter=new ExtentHtmlReporter("HTML_Report_"+timeStamp+".html");
        
        ExtentReports extent = new ExtentReports();
        
       extent.attachReporter(reporter);
        
        }
    
    public void createrepo(String TestCase)
    {
                
        logger=extent.createTest(TestCase);
    }
    
    
    
    public void tearDown() 
    {
        
            
        extent.flush();
        
        
    }
    
}
 类似资料:
  • 我使用Gauge framework进行自动测试,我想使用Allure生成报告。不幸的是,Allure没有这个适配器。我的项目由几个模块组成,每个模块都有自己的pom.xml。 Main pom.xml(片段): 仪表以JUnit XML模式格式将自己XML报表生成为'reports/XML-report/result.XML'。Allure生成一个空报告到'ALLURE-REPORT',因为al

  • 如何为cucumber testng framework生成扩展报告,以便在每个场景失败时都能捕获屏幕截图,而无需在步骤定义文件中的每个场景中重复代码 我已经使用Cucumber Testng设置了测试框架。然而,我需要数据块报告,但不确定如何通过testNG runner类实现它,而不必在步骤定义的每个场景中实际重复代码。因此,我们的想法是在一个地方编写代码,就像使用cucumber钩子一样,它

  • 我们的团队使用JUnit作为一个大型老项目的基础测试框架。我们最近迁移到Maven,并决定尝试一个名为Allure的JUnit新报告。我们从下面的示例中将依赖项和插件复制到pom.XML,但在target/folder中没有生成XML数据。Maven输出中不会发出警告或错误。有人知道怎么会这样吗?

  • 通过命令行报告生成工具生成报告时,我得到以下错误。 线程“main”ru.yandex.qatools.allure.data中出现异常。ReportGenerationException on:在ru.yandex.qatools.allure.data.AllureReportGenerator中找不到任何诱惑结果。在ru.yandex.qatools.allure.data.AllureRe

  • 21. 与其他Web框架集成 21.1简介 Spring Web Flow Spring Web Flow (SWF) 旨在成为管理Web应用程序页面流的最佳解决方案。 SWF与Servlet和Portlet环境中的Spring MVC和JSF等现有框架集成。 如果您有一个业务流程(或流程)将受益于会话模型而不是纯粹的请求模型,则SWF可能是解决方案。 SWF允许您将逻辑页面流作为在不同情况下可重

  • 我试图在SparkJava中使用下面的etcd框架 https://github.com/AdoHe/etcd4j 代码如下所示: 但是当我尝试访问下面的url时http://localhost:4567/hello 我得到以下错误 我在这里遗漏了什么?etcd在作为独立项目使用main()函数时工作,但是不与SparkJava一起工作,是否有任何etcd客户端与SparkJava一起工作?