Selenium webdriver 如何在扩展报告2.41.2的标题中添加徽标
我想在扩展数据块报告中添加图像。我在XML中尝试了以下代码Selenium webdriver 如何在扩展报告2.41.2的标题中添加徽标,selenium-webdriver,extentreports,selenium-extent-report,Selenium Webdriver,Extentreports,Selenium Extent Report,我想在扩展数据块报告中添加图像。我在XML中尝试了以下代码 <?xml version="1.0" encoding="UTF-8"?> <suite name="MYhoenixTestExecution" verbose="1" > <!-- <listeners> <listener class-name="org.uncommons.reportng.HTMLReporter" /> <listener class-name
<?xml version="1.0" encoding="UTF-8"?>
<suite name="MYhoenixTestExecution" verbose="1" >
<!-- <listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter" />
<listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners> -->
<listeners>
<listener class-name="phoenix.report.ExtentReporterNG" />
</listeners>
<reportHeadline>Automation Report <image id="image-zoom">
<![CDATA[
<img src='C:\CATS\logo.png'/>
]]>
</image></reportHeadline>
<image id="image-zoom">
<![CDATA[
<img src='C:\CATS\logo.png'/>
]]>
</image>
<test name="Myphoenix_Login TC" >
<classes>
<class name="phoenix.testcases.Login_TC"/>
</classes>
</test>
自动化报告
但仍然无法添加徽标。请提出建议。我已经用3.1.2版成功地做到了这一点 下面是我的extent-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- standard, dark -->
<theme>dark</theme>
<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>
<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>https</protocol>
<!-- title of the document -->
<documentTitle>TRAX</documentTitle>
<!-- report name - displayed at top-nav -->
<reportName>
<![CDATA[
<img src='.//myCompanyLogo.svg' />
]]>
</reportName>
<!-- location of charts in the test view -->
<!-- top, bottom -->
<testViewChartLocation>bottom</testViewChartLocation>
<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
<!-- custom styles -->
<styles>
<![CDATA[
.report-name { padding-left: 10px; } .report-name > img { float:
left;height: 90%;margin-left: 30px;margin-top: 2px;width: auto; }
]]>
</styles>
</configuration>
</extentreports>
黑暗的
UTF-8
https
特拉克斯
底部
img{float:
左侧;高度:90%;左侧边距:30px;顶部边距:2px;宽度:自动;}
]]>
请注意,您必须注意图像的位置。在填充html.report之前,我已将公司徽标放在徽标文件夹中,并将其复制到Reports文件夹中。只是猜测,但该功能可能仅在商业版中可用?你也应该考虑更新到3。X社区版。在因特网上有大量的文章可以说明如何做,但是对于那些仍然在寻找的人:请检查一下。