Java 使用selenium更改ExtendReports的样式
我们是否可以在selenium中更改Extend报告的样式。例如,pass以绿色突出显示,是否有办法将pass测试用例的颜色更改为其他颜色。您可以在区段配置.xml中进行更改,并在运行@BeforeSuite下的脚本时加载它 通过使用这个外部XML文件(extent config.XML),我们可以更改诸如报告主题(标准或暗)、报告标题、文档标题等细节,我们使用extent对象并使用loadConfig()方法加载这个XML文件Java 使用selenium更改ExtendReports的样式,java,selenium,extentreports,Java,Selenium,Extentreports,我们是否可以在selenium中更改Extend报告的样式。例如,pass以绿色突出显示,是否有办法将pass测试用例的颜色更改为其他颜色。您可以在区段配置.xml中进行更改,并在运行@BeforeSuite下的脚本时加载它 通过使用这个外部XML文件(extent config.XML),我们可以更改诸如报告主题(标准或暗)、报告标题、文档标题等细节,我们使用extent对象并使用loadConfig()方法加载这个XML文件 @BeforeSuite public void beforeSu
@BeforeSuite
public void beforeSuite() {
extentReport = new ExtentReports(System.getProperty(“user.dir”) + “/test-output/ExtentReport.html”,true);
extentReport.addSystemInfo(“Host Name”, “XYZ”).addSystemInfo(“Environment”, “Dev”).addSystemInfo(“User Name”, “ABC”);
extentReport.loadConfig(new File(System.getProperty(“user.dir”) + “\\extent-config.xml”));
}
参考您可以在区段配置.xml中进行更改并在运行@BeforeSuite下的脚本时加载它 通过使用这个外部XML文件(extent config.XML),我们可以更改诸如报告主题(标准或暗)、报告标题、文档标题等细节,我们使用extent对象并使用loadConfig()方法加载这个XML文件
@BeforeSuite
public void beforeSuite() {
extentReport = new ExtentReports(System.getProperty(“user.dir”) + “/test-output/ExtentReport.html”,true);
extentReport.addSystemInfo(“Host Name”, “XYZ”).addSystemInfo(“Environment”, “Dev”).addSystemInfo(“User Name”, “ABC”);
extentReport.loadConfig(new File(System.getProperty(“user.dir”) + “\\extent-config.xml”));
}
参考文献