1.解析Robot执行结果的python文件如下:
#coding:utf-8
import sys
import getopt
import xml.etree.ElementTree as ET
def print_node(node):
print "=============================================="
print "node.attrib:%s" % node.attrib
print "node.tag:%s" % node.tag
print "node.text:%s" % node.text
if node.attrib.has_key("name"):
print "node.attrib['rank']:%s" % node.attrib['name']
def checkRes(aFile):
failNum=0
tree = ET.parse(aFile)
root = tree.getroot()
first_node = root.getiterator("total")
first_node_child = first_node[0].