首页 > 解决方案 > 如何在 Loadrunner VUGen 中获取整个响应体?

问题描述

我需要在 Loadrunner VUGen 中获取整个响应体。我试试

web_set_max_html_param_len("60000");
web_reg_save_param_ex(
    "ParamName=js_top",
    "LB=",
    "RB=",
    SEARCH_FILTERS,
    "Scope=Body",
    LAST);
web_url("categories",
        "URL=https://advantageonlineshopping.com/catalog/api/v1/categories", 
        "TargetFrame=", 
        "Resource=0", 
        "RecContentType=application/json", 
        "Referer=https://advantageonlineshopping.com/", 
        "Snapshot=t20.inf", 
        "Mode=HTML", 
        LAST);

但得到一个错误:Action.c(147): Error -26377: No match found for the requested parameter "js_top"。在响应中找不到指定的边界,或者匹配的文本长于当前最大 html 参数大小 60000 字节。响应的总长度为 4477 字节。您可以使用“web_set_max_html_param_len”来增加最大参数大小。[消息 ID:MERR-26377]

标签: performance-testingloadrunner

解决方案


尝试在下面使用,如果您遇到任何问题,请告诉我。

web_set_max_html_param_len("9999999");
web_reg_save_param("c_fullresponse", "LB=", "RB=", LAST);
web_url("categories",
        "URL=https://advantageonlineshopping.com/catalog/api/v1/categories", 
        "TargetFrame=", 
        "Resource=0", 
        "RecContentType=application/json", 
        "Referer=https://advantageonlineshopping.com/", 
        "Snapshot=t20.inf", 
        "Mode=HTML", 
        LAST);

如果仍然出现错误,请尝试启用 Log。从运行时设置中的日志中打开服务器跟踪。启用日志后,您将收到响应。从这些数据中,您可以决定需要什么 LB 或 RB 来捕获完整的响应。


推荐阅读