如何在 extent-report.html 中添加 xml 数据(包含标签)

How to add xml data(containing tags) in extent-report.html

我正在尝试将 xml 字符串添加到我的范围报告中。而是将其视为 html 标签并显示在 dom 而不是 UI.

我尝试在 xml 字符串前后添加字符,然后打印字符而不是 xml 数据

Reporter.addStepLog("text is <"+"<response><abc value=10></abc></response>"+">"

我希望报告显示 o/p 因为-> 文本是 <<response><abc value=10></abc></response>> 但我得到->文本是<>
P.S.:如果你看到控制台,你就会明白我要解释的内容!

您可以尝试使用以下 html 元素:

Reporter.addStepLog("text is <textarea rows='20' cols='40' style='border:none;'>"+"<response><abc value=10></abc></response>"+"</textarea>");

有关信息,我在此站点上发现了这个技巧: Display XML content in HTML page