51Testing软件测试论坛

标题: loadrunner测试文件下载问题 [打印本页]

作者: sinotitan    时间: 2011-11-21 16:44
标题: loadrunner测试文件下载问题
脚本:
Action()
{
        int returnCode;
    float fFileDownloadSize, fFileDownloadTime, fFileDownloadRate;

        lr_output_message("------------Test is Starting-------------");

        web_url("xxxxxx.ocx",
                "URL=http://www.xxxx.com/update/xxx/xxxxxx.ocx",
                "Resource=1",
                "RecContentType=text/plain",
                "Referer=",
                "Snapshot=t4.inf",
                LAST);
        returnCode = web_get_int_property(HTTP_INFO_RETURN_CODE);     
        lr_output_message("Return Code = %d",returnCode);
        if(returnCode != 200)
                return -1;
        fFileDownloadSize = (web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE)/1024.); //in kilobytes
        fFileDownloadTime = (web_get_int_property(HTTP_INFO_DOWNLOAD_TIME)/1000.); //in seconds
        if(fFileDownloadTime > 0)
        fFileDownloadRate = fFileDownloadSize/fFileDownloadTime; //in KB/s
       
        lr_output_message("Size of download was %.0f kilobytes; Time of download was %.3f seconds", fFileDownloadSize, fFileDownloadTime);
        lr_output_message("Rate of download was %.2f KB/sec", fFileDownloadRate);
        return 0;
}

问题:
1、文件超过1M,只能下载到577K左右
2、测试的过程中怎么看lr_output_message输出
作者: msnshow    时间: 2011-11-22 21:00
下载感觉没必要用LR来测




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2