python roboot解析 output.xml -3【最好:robot库】

  1. 基本
from robot.api import SuiteVisitor


class TestStatusChecker(SuiteVisitor):

    def __init__(self, *args):
        pass

    def visit_test(self, test):
        if 'PASS' in test.message and 'Re-executed test has been merged' in test.message:
            test.status = 'PASS'
            test.message = 'Test passed because it passed at least once.'


# CLI command for merging the results:
# rebot -l final_log.html --prerebotmodifier TestStatusChecker.py --merge 1.xml 2.xml 3.xml 4.xml

原文地址:https://www.cnblogs.com/amize/p/14962377.html