1

什么是CTS?
Compatibility Test Suite

CTS测试完会生成XML文件,这个XML人工根据Fail提交bug较麻烦,故根据此用python写了一个分析工具,先挖个坑,先贴核心代码:

from bs4 import BeautifulSoup
def findCTSfail(filename,xlist):
    node =list()
    soup = BeautifulSoup(open(filename),"lxml")
    for child in soup.find_all(result="fail"):
        nodevalue = child.parent
        while nodevalue.name != "testpackage":
            node.append(nodevalue["name"])
            nodevalue=nodevalue.parent
        xlist.append(".".join(node[::-1])+" -- "+child["name"])

    print xlist

findCTSfail("testResult.xml",Nexus5cts)

最新的博客请移步这里


oliverhuang
30 声望1 粉丝