如何在 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):错误 -26377:找不到与请求的参数“js_top”匹配的内容。在响应中未找到指定的边界,或者匹配的文本长于 60000 字节的当前最大 html 参数大小。响应的总长度为 4477 字节。您可以使用“web_set_max_html_param_len”来增加最大参数大小。 [消息 ID:MERR-26377]

解决方法

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

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);

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