【发布时间】:2020-03-01 14:09:20
【问题描述】:
已捕获 web_reg_save_param 并且计数值未保存到新声明的变量中。
我尝试过在全局和本地声明。
int ExsistingGoal;
char ParamName[50];
int i;
// {"id":"49F2DC5064524DC3962EE783959CA211","name":"Legacy Protection 1",
web_reg_save_param("c_ExsistingGoal","LB=
{\"id\":\"","RB=\",\"name\":\"","ORD=All",LAST);
web_add_header("Authorization:","Bearer {c_Token05}");
web_add_header("X-request-ID","8dd9e540-fa3c-11e9-8c6b-47e84a716a57");
web_url("goals_3",
"URL={pURL02}/wms/v1/plan/plans/{c_PlanID}/goals?entityId= {c_EntityID}",
"TargetFrame=",
"Resource=0",
"RecContentType=application/json",
"Referer={pURL02}/mwp/select-goals",
"Snapshot=t79.inf",
"Mode=HTML",
LAST);
ExsistingGoal= atoi(lr_eval_string("{c_ExsistingGoal_count}"));
c_ExsistingGoal_count 这个值应该被保存到变量中
ExsistingGoal.
但目前它正在显示一些随机值:153500656
【问题讨论】:
-
您应该开始拆解该指令。
lr_eval_string返回什么?c_ExsistingGoal_count应该从哪里来?第一个“s”是错字吗?你的意思是c_ExistingGoal_count?顺便说一句:除了最后一个陈述之外,还有什么与您的问题有关吗? -
c_ExsistingGoal --> 值是从请求中获取的 web_url("goals_3" web_reg_save_param(); 应该保存所有可能的值与我使用的左右边界相同 Ord=all O/P计数值应保存在贴花变量“ExsistingGoal”中。(lr_eval_string("{c_ExsistingGoal_count}") 应返回值:3
-
我看到了很多“应该”。您是否验证了您的任何假设?
lr_eval_string返回什么?它返回一个字符串,还是NULL? -
我可以回答 Gerhardh 的一些问题,值数组是由LaodRunner 服务函数 web_reg_save_param() 播种的,它充当一个筛子,通过它倾倒 HTML,LB 和 RB 条件定义什么被捕获。这会产生一个值数组,ORD=ALL 引用,
_1 到 n。 n 的值存储在 _count 中。在这种情况下,参数名称是 c_ExsistingGoal。我最好的猜测是条件不会导致数组填充,它返回的是地址而不是值 -
当您打开参数数据的日志记录时,在您进行转换和分配给 C 变量之前,您是否看到值被填充为数组的一部分
标签: c performance-testing loadrunner