http接口自动化测试框架实现(2)

发表于:2011-09-01来源:未知作者:领测软件测试网采编点击数: 标签:自动化测试
#获取参数名存入ArgNameList ArgNameList=[] for i in range(0, argcount): ArgNameList.append(Data.read_data(SuiteID, Data.titleindex, Data.argbegin+i)) caseinfolist.append(sInterface) caseinfolist

  #获取参数名存入ArgNameList

  ArgNameList=[]

  for i in range(0, argcount):

  ArgNameList.append(Data.read_data(SuiteID, Data.titleindex, Data.argbegin+i))

  caseinfolist.append(sInterface)

  caseinfolist.append(argcount)

  caseinfolist.append(ArgNameList)

  return caseinfolist

  #获取输入

  def get_input(Data, SuiteID, CaseID, caseinfolist):

  sArge=''

  #参数组合

  for j in range(0, caseinfolist[1]):

  if Data.read_data(SuiteID, Data.casebegin+CaseID, Data.argbegin+j) != "None":

  sArge=sArge+caseinfolist[2][j]+'='+Data.read_data(SuiteID, Data.casebegin+CaseID, Data.argbegin+j)+'&'

  #去掉结尾的&字符

  if sArge[-1:]=='&':

  sArge = sArge[0:-1]

  sInput=caseinfolist[0]+sArge #组合全部参数

  return sInput

  #结果判断

  def assert_result(sReal, sExpect):

  sReal=str(sReal)

  sExpect=str(sExpect)

  if sReal==sExpect:

  return 'OK'

  else:

  return 'NG'

  

原文转自:http://www.ltesting.net