예제 #1
0
def start():
    row_date = 1
    andf = 1
    fromt = 1
    andm = 1
    tot =1
    bb = ''

    file = 'D:\work\code\ctriptest\datebase1.xls'
    data = read_excel.open_excel(file)
    table = data.sheet_by_name('type')
    typelist = []
    for row_date in range(1, read_excel.rownum(file,'type')):
        bb = table.cell(row_date, read_excel.find_colum(file,'type','keyword')).value
        #bb = 'shanghai'
        reload(sys)
        sys.setdefaultencoding('utf-8')
        bb = str(bb)
        #time.sleep(2)
        aa = urllib.quote(bb)
        url = 'http://10.2.25.24:8180/appautocomplete/search?keyword='+aa+'&action=autocomplete&source=globalapp63&lon=121.35801673&lat=31.22016018&districtid=2'
        lennum = http.lendate(url)
        num = 0
        for num in range(lennum):
            #print http.get_key_vlue(url,num,"type")
            if http.get_key_vlue(url,num,"type") not in typelist:
                typelist.append(http.get_key_vlue(url,num,"type"))
                print http.get_key_vlue(url,num,"word"), http.get_key_vlue(url,num,"type")
예제 #2
0
def start():
    row_date = 1
    andf = 1
    fromt = 1
    andm = 1
    tot =1
    bb = ''

    file = 'D:\work\code\ctriptest\datebase1.xls'
    data = read_excel.open_excel(file)
    table = data.sheet_by_name('all')
    f = open('ok.txt', 'w')
    f1 = open('no1.txt', 'w')
    f2 = open('no2.txt', 'w')
    f3 = open('no.txt', 'w')
    for row_date in range(1, read_excel.rownum(file,'all')):
        bb = table.cell(row_date, read_excel.find_colum(file,'all','keyword')).value
        #bb = 'shanghai'
        reload(sys)
        sys.setdefaultencoding('utf-8')
        bb = str(bb)
        result = Language_result(bb)
        time.sleep(1)
        if result[0] == "1":
            f.write(result[1])
            f.write("\n")
        else:
            f1.write("############################################")
            f1.write("\n")
            f1.write(result[1])
            f1.write("\n")
            f1.write("############################################")
            f1.write("\n")
            f1.write(result[2].replace(",","\n"))
            f1.write("\n")

            f2.write("############################################")
            f2.write("\n")
            f2.write(result[1])
            f2.write("\n")
            f2.write("############################################")
            f2.write("\n")
            f2.write(result[3].replace(",","\n"))
            f2.write("\n")

            f3.write(result[1])
            f3.write("\n")

    f.close()
    f1.close()
    f2.close()
    f3.close()
예제 #3
0
#b:多保险公司
#c:多保险类型
#k:目的地+多保险公司
#h:目的地+多保险类型
#i:多保险类型+多保险公司
#j:目的地+多保险类型+多保险公司


#测试每条case的errcode,word,insurance,url中含的destination,FeatureList,CompanyList个数和值,mobileweb可以测url跳转后值界面的值是否正确
#输出每个globalapp63的url和keyword,用来跳转用

#报告输出格式为:成功
#                失败:关键字+失败的内容+应该的值+目前的值
###################################################
file = testcasedata.RegressionTestDate()
data = read_excel.open_excel(file)
c = "globalapp64"
#c = "mobileweb"
keyword = ''
def test_case_a(data,c):
    keywordvlue = "destination"
    #keywordvlue = "CompanyList"
    #keywordvlue = "FeatureList"
    table = data.sheet_by_name('url')
    urlhttp = table.cell(1, read_excel.find_colum(file,'url','url')).value+"action=autocomplete&source=globalapp64&lon=121.35801673&lat=31.22016018&districtid=2"+"&keyword="+keyword
    for row_date in range(1, read_excel.rownum(file,'insurance')):
        table = data.sheet_by_name('insurance')
        bb = table.cell(row_date, read_excel.find_colum(file,'insurance',keywordvlue)).value
        reload(sys)
        sys.setdefaultencoding('utf-8')
        bb = str(bb)