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
文章來源于領測軟件測試網 http://www.kjueaiud.com/