如何将多个TestNG套件结果合并到一个报表

如何将多个TestNG套件结果合并到一个报表

本文介绍了如何将多个TestNG套件结果合并到一个报表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这里有一个问题在我的工作。我有几个TestNG案例,如果在主批次的测试案例中运行,在其他测试案例中会出现havock。而不是通过和改变我们的所有测试用例,我已经为相关的案件做了一个小组。我运行主测试套件,排除该组,然后进行第二个Ant调用以运行受影响的组。这样所有的测试用例都通过,但是我最终必须创建两个TestNG报告,以便第一个不会覆盖第二个组的结果。

So here's an issue at my work. I've got a few TestNG cases that, if run within the primary batch of test cases, wreak havock throughout the other test cases. Rather than going through and changing all our test cases, I've made a group for the involved cases. I run the main test suite, excluding that group, and then make a second Ant call to run the affected group. This way all test cases pass, but I'm ending up having to create two TestNG reports so that the first one doesn't get overriden with the results from the second group.

这里是我的问题:是否可能合并第二个测试结果报告与第一个,或者我困住了两个?

So here's my question: is it possible to merge the second test result report with the first, or am I stuck with the two?

推荐答案

我认为,唯一能做到这一点的方法是在两次运行后处理TestNG XML输出。您应该能够整理两次运行中的XML文件,并使用。

I think that the only way you would be able to do this is to process the TestNG XML output after the two runs. You should be able to collate the XML files from the two runs and combine it into a single HTML report using the Ant JUnit Report task.

如果您不满意从中获得的输出,可能是因为TestNG组织其JUnit XML输出奇怪。如果您在我的中使用JUnitXMLReporter,并执行JUnit报表,就能取得更理想的结果

If you aren't happy with the output you get from this, it could be because TestNG organises its JUnit XML output oddly. You get better results (in my opinion) if you use the JUnitXMLReporter from my ReportNG project and run JUnit Report on that.

或者,您也许可以使用为TestNG将两个测试运行的XML输出合并成一个HTML报告,虽然我不知道它是否支持这个。

Alternatively, you might be able to use this XSLT reporter for TestNG to combine the XML output from the two test runs into a single HTML report, though I've no idea if it supports this or not.

这篇关于如何将多个TestNG套件结果合并到一个报表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 13:07