ant; WORD-BREAK: break-all"> Data.write_data(SuiteId, Data.casebegin+CaseId, resultcol,result[0], NG_COLOR)
elif result[0]=='OK':
Data.write_data(SuiteId, Data.casebegin+CaseId, resultcol,result[0], OK_COLOR)
else: #NT
Data.write_data(SuiteId, Data.casebegin+CaseId, resultcol,result[0], NT_COLOR)
Data.allresult.append(result[0])
#将当前结果立即打印
print 'case'+str(CaseId+1)+':', Data.allresult[-1]
#打印测试结果
def statisticresult(excelobj):
allresultlist=excelobj.allresult
count=[0, 0, 0]
for i in range(0, len(allresultlist)):
#print 'case'+str(i+1)+':', allresultlist[i]
count=countflag(allresultlist[i],count[0], count[1], count[2])
print 'Statistic result as follow:'
print 'OK:', count[0]
print 'NG:', count[1]
print 'NT:', count[2]
#解析XmlString返回Dict
def get_xmlstring_dict(xml_string):
xml = XML2Dict()
return xml.fromstring(xml_string)
#解析XmlFile返回Dict
def get_xmlfile_dict(xml_file):
xml = XML2Dict()
return xml.parse(xml_file)
#去除历史数据expect[real]
def delcomment(excelobj, suiteid, iRow, iCol, str):
startpos = str.find('[')
if startpos>0:
str = str[0:startpos].strip()
excelobj.write_data(suiteid, iRow, iCol, str, OK_COLOR)
return str
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/