我使用的是 LoadRunner 版本 12.02 - Build 2739
查看旧的但正确的“指南”表明我已经正确使用了这些语句(第三点,大约页面下方的 1/3,在代码块内 -the atoi陈述 http://motevich.blogspot.co.il/2007/11/loadrunner-correlation-dynamic-data.html).
但我仍然无法将 _count 参数转换为 int-Variable。
在脚本中,在调用之前;
web_reg_save_param(
"ParamName=rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);
在 web 调用 save_param 函数之前放置之后,输出日志显示;
Notify: Saving Parameter "ParamName=rotaPeople_count = 21".
在脚本内部,调用后,计数已总计;
lr_output_message("RP_C:%d",lr_eval_string("{rotaPeople_count}"));
lr_output_message("RP_C:%s",lr_eval_string("{rotaPeople_count}"));
peoplesCount = atoi(lr_eval_string("{rotaPeople_count}"));
lr_output_message("PC:%d",peoplesCount);
上述执行完成后的日志中;
Warning: The string 'rotaPeople_count' with parameter delimiters is not a parameter.
RP_C:110826864
Warning: The string 'rotaPeople_count' with parameter delimiters is not a parameter.
RP_C:{rotaPeople_count}
Warning: The string 'rotaPeople_count' with parameter delimiters is not a parameter.
PC:0
有人有主意吗?
注意:警告消息是预期的
注意:解决方法:已使用web_reg_save_param_regex()
并创建了一个正则表达式。在 for 循环中使用返回的 _count 参数是可行的。保持问题开放,因为原来的问题仍然存在