zoukankan      html  css  js  c++  java
  • Loadrunner 下载文件

    Loadrunner 下载文件到windows系统

    Download()
    {
    
        int flen;
        long filedes;
        char file[256]="";
        char * time;
        time=lr_eval_string("<current_time}");//current time from parameter list
        strcat(file,"E:\doc\");
        strcat(file,"time");
        strcat(file,".zip");//create a file
        web_set_max_html_param_len("800000");
        
        web_submit_data("efsnPackage.do_worksheetListUpdate", 
            "Action=<url}bin-java/efsnPackage.do_worksheetListUpdate", 
            "Method=POST", 
            "RecContentType=text/html", 
            "Referer=", 
            "Snapshot=t9.inf", 
            "Mode=HTML", 
            ITEMDATA, 
            "Name=selectlist", "Value=download", ENDITEM, 
            "Name=actionsubmit", "Value=Submit", ENDITEM, 
            "Name=vendor", "Value=20009376_102260_20009376", ENDITEM, 
            "Name=islocked", "Value=0", ENDITEM, 
            "Name=worksheetid", "Value=20009376", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=0", ENDITEM, 
            "Name=worksheetid", "Value=20014439", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20016264", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20019248", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20021807", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20011990", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20022784", ENDITEM, 
            "Name=vslice", "Value=102265", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20012385", ENDITEM, 
            "Name=vslice", "Value=102265", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20024706", ENDITEM, 
            "Name=vslice", "Value=102266", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20014432", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20019933", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20009876", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20016877", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20016260", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20012253", ENDITEM, 
            "Name=vslice", "Value=102261", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20011983", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20011150", ENDITEM, 
            "Name=vslice", "Value=102265", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20024228", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20019244", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20021842", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20022777", ENDITEM, 
            "Name=vslice", "Value=102265", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20024539", ENDITEM, 
            "Name=vslice", "Value=102266", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20019592", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20019240", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20028994", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20035019", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20028998", ENDITEM, 
            "Name=vslice", "Value=102262", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20015513", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20017513", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20029345", ENDITEM, 
            "Name=vslice", "Value=102264", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20029358", ENDITEM, 
            "Name=vslice", "Value=102265", ENDITEM, 
            "Name=islocked", "Value=1", ENDITEM, 
            "Name=worksheetid", "Value=20020505", ENDITEM, 
            "Name=vslice", "Value=102260", ENDITEM, 
            "Name=selectlist2", "Value=download", ENDITEM, 
            "Name=totalnumberofworksheets", "Value=0", ENDITEM, 
            EXTRARES, 
            "Url=../branding/7thonline/7thonline_logo.svgz", "Referer=<url}bin-java/efsnPackage.do_downloadSelectedOptions", ENDITEM, 
            "Url=../branding/7thonline/bg-nav-search-top_grey.gif", "Referer=<url}bin-java/efsnPackage.do_downloadSelectedOptions", ENDITEM, 
            "Url=../branding/7thonline/btn-nav-search-top_bt.png", "Referer=<url}bin-java/efsnPackage.do_downloadSelectedOptions", ENDITEM, 
            "Url=../branding/7thonline/bg-nav-search-bottom_trans.png", "Referer=<url}bin-java/efsnPackage.do_downloadSelectedOptions", ENDITEM, 
            "Url=../images/common/loadingAnimation.gif", "Referer=<url}bin-java/efsnPackage.do_downloadSelectedOptions", ENDITEM, 
            LAST);
    
        lr_start_transaction("02_Download_WS");
    
        web_submit_data("efsnPackage.do_orderWorksheetDownloadAll", 
            "Action=<url}bin-java/efsnPackage.do_orderWorksheetDownloadAll", 
            "Method=POST", 
            "RecContentType=text/html", 
            "Referer=<url}bin-java/efsnPackage.do_downloadSelectedOptions", 
            "Snapshot=t10.inf", 
            "Mode=HTML", 
            ITEMDATA, 
            "Name=downloadmonthly", "Value=0", ENDITEM, 
            "Name=editmonthdata", "Value=2", ENDITEM, 
            "Name=downloadtype", "Value=selected", ENDITEM, 
            "Name=submit", "Value=Wait", ENDITEM, 
            LAST);
    //to get the whole response of this request and save it in "fcontent" web_reg_save_param(
    "fcontent", "LB=", "RB=", "Search=BODY", LAST); web_submit_form("efsnPackage.do_orderWorksheetDownloadZip", "Snapshot=t11.inf", ITEMDATA, LAST); flen=web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE); if(flen>0) { if((filedes=fopen(file,"wb"))==NULL) { lr_output_message("open file failed");
    return -1; } } fwrite(lr_eval_string(
    "<fcontent}"),flen,1,filedes); fclose(filedes); lr_end_transaction("02_Download_WS",LR_AUTO); return 0; }

     current_time:

  • 相关阅读:
    Anaconda 安装tensorflow(GPU)
    冲量:momentum
    pytorch学习笔记
    python的新特性
    pytorch
    ubuntu16.04 eclipse+pydev 配置
    ubuntu16.04 源码方法安装tensorflow
    django xadmin查找当前用户所在组
    django filter or 多条件查询
    django后台对某些字段设置颜色
  • 原文地址:https://www.cnblogs.com/jinggo/p/7680939.html
Copyright © 2011-2022 走看看