ant; MARGIN: 10px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; WORD-BREAK: break-all; PADDING-TOP: 0px">
#import MySQLdb
#Excel表格中测试结果底色
OK_COLOR=0xffffff
NG_COLOR=0xff
#NT_COLOR=0xffff
NT_COLOR=0xC0C0C0
#Excel表格中测试结果汇总显示位置
TESTTIME=[1, 14]
TESTRESULT=[2, 14]
#Excel模版设置
#self.titleindex=3 #Excel中javascript:;" target=_self>测试用例标题行索引
#self.casebegin =4 #Excel中测试用例开始行索引
#self.argbegin =3 #Excel中参数开始列索引
#self.argcount =8 #Excel中支持的参数个数
class create_excel:
def __init__(self, sFile, dtitleindex=3, dcasebegin=4, dargbegin=3, dargcount=8):
self.xlApp = win32com.client.Dispatch('et.Application') #MS:Excel WPS:et
try:
self.book = self.xlApp.Workbooks.Open(sFile)
except:
print_error_info()
print "打开文件失败"
exit()
self.file=sFile
self.titleindex=dtitleindex
self.casebegin=dcasebegin
self.argbegin=dargbegin
self.argcount=dargcount
self.allresult=[]
self.retCol=self.argbegin+self.argcount
self.xmlCol=self.retCol+1
self.resultCol=self.xmlCol+1
文章来源于领测软件测试网 https://www.ltesting.net/