51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 1872|回复: 5
打印 上一主题 下一主题

求助:loadrunner回放zip文件下载脚本报错

[复制链接]
  • TA的每日心情
    无聊
    2017-11-26 18:46
  • 签到天数: 382 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2016-6-14 11:44:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    求助各位大神大侠:

    测试从服务器下载zip文件,测试服务器承受的下载性能。

    脚本是网上找的,直接在LR中编辑脚本,但是在回放的时候总是会报错。

    已经 取消了 Download non-HTML resources 的勾选
    并且:HTTP-request connect timeout(sec),HTTP-request recive timeout(sec), HTTP Keep-Alive timeout(sec)  三个都设置成 50000了。


    但是回放日志中总是会报错:


    Notify: Transaction "Download" started.
    Action.c(28): web_url("VideoCompanion-V2.35.160527.zip") started          [MsgId: MMSG-26355]
    Action.c(28): Resource "http://********.zip" not downloaded (resource downloading not requested)          [MsgId: MMSG-27299]   //下载的网址省略屏蔽
    Action.c(28): Warning -26379: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) are deleted and will be handled as "not found"          [MsgId: MWAR-26379]
    Action.c(28): Error -26377: No match found for the requested parameter "Filecontent". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 99999999 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
    Action.c(28): Notify: Saving Parameter "Filecontent = ".
    Action.c(28): Error -26374: The above "not found" error(s) may be explained by header and body byte counts being 0 and 0, respectively.          [MsgId: MERR-26374]
    Action.c(28): Notify: Transaction "Download" ended with "Fail" status (Duration: 0.0144).
    Ending action Action.




    脚本内容:

    Action()
    {

            int flen;
            long filedes;
            char file[256]="\0";
            //char file[256]="";

            web_set_max_html_param_len("99999999");

            web_concurrent_start(NULL);

            web_reg_save_param("Filecontent",
                                               "LB=",
                                               "RB=",
                                               "Search=ALL",
                                               LAST);
           
            lr_rendezvous("Download");


            web_url("******.zip",                                             //下载的文件名省略屏蔽
                            "URL=http://************.zip",          //下载的网址省略屏蔽
                            "Resource=1",
                            "RecContentType=application/zip",
                            "Referer=",
                            "Snapshot=t1.inf",
                            LAST);

            web_concurrent_end(NULL);

            strcat(file,"D:\\");
            strcat(file,lr_eval_string("*****.zip"));          //下载的文件名省略屏蔽

            flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);

            if(flen > 0)
            {
                    if((filedes = fopen(file, "wb")) == NULL)
                    {
                            lr_output_message("Open file failed!",lr_eval_string("{Filecontent}"));
                            return -1;
                    }

                    fwrite(lr_eval_string("{Filecontent}"),flen, 1, filedes);
                    fclose(filedes);
            }


            return 0;
    }


    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    6 天前
  • 签到天数: 2663 天

    连续签到: 3 天

    [LV.Master]测试大本营

    2#
    发表于 2016-6-14 13:47:42 | 只看该作者
    web_reg_save_param这是关联的脚本,需要从服务返回进行关联,你的报错提示关联失败

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 积极回复获得测试积点10

    查看全部评分

    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2017-11-26 18:46
  • 签到天数: 382 天

    连续签到: 1 天

    [LV.9]测试副司令

    3#
     楼主| 发表于 2016-6-14 17:00:12 | 只看该作者
    jingzizx 发表于 2016-6-14 13:47
    web_reg_save_param这是关联的脚本,需要从服务返回进行关联,你的报错提示关联失败

    版主大咖,我把这个关联的脚本注释掉之后就能正常运行脚本了,但是脚本运行后之后,下载到本地的文件却又是0KB的,这个能帮忙解释一下呢?
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
    发表于 2016-6-17 10:58:18 | 只看该作者
    神仙也考试 发表于 2016-6-14 17:00
    版主大咖,我把这个关联的脚本注释掉之后就能正常运行脚本了,但是脚本运行后之后,下载到本地的文件却又 ...

    把关联去掉后,跑的脚本中cookie已经失效了,脚本其实是失败的!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2017-11-26 18:46
  • 签到天数: 382 天

    连续签到: 1 天

    [LV.9]测试副司令

    5#
     楼主| 发表于 2016-6-17 12:00:07 | 只看该作者
    lewtone 发表于 2016-6-17 10:58
    把关联去掉后,跑的脚本中cookie已经失效了,脚本其实是失败的!

    那有什么办法可以解决呢???

    我看网上很多写的关联条件也都是这么写的。
    有没更好的例子可以参考呢?
    谢谢!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    郁闷
    2017-3-8 08:52
  • 签到天数: 60 天

    连续签到: 1 天

    [LV.6]测试旅长

    6#
    发表于 2016-6-22 09:44:19 | 只看该作者
    你这个关联函数有问题吧,这个左边界值和右边界值是这样写的吗?你要去找到这个需要关联的数据,然后参数化
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-6 01:30 , Processed in 0.066898 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表