如何在左边界中传递先前的参数值以用于Load runner中的其他相关参数

时间:2017-04-24 15:31:33

标签: correlation loadrunner

我在Load runner [WEB HTTP / HTML]中开发了脚本。

相关参数之一是下一个相关参数的左边界

有人可以帮助提供在下一个相关参数值的左边界中使用先前相关参数值的方法吗?

web_reg_save_param("documentHash", lr_eval_string("LB={token}"), "RB=')","Ordinal=1", LAST);

2 个答案:

答案 0 :(得分:1)

您可以在左边界使用您的参数,如下所示:

web_reg_save_param("documentHash", lr_eval_string("LB={token}"), "RB=')", LAST);

答案 1 :(得分:0)

因为我已经在评论中发布了代码。我是一个例子的详细答案。

示例网站

在此示例中,我们将https://www.example.com演示c = { 1:0 , 1:2...1:6 , 2:0 , 2:1 , 2:2 ,...2:6}

以下是www.example.com的输出。我们将使用web_reg_save_param_ex();检索标记的文本。

Example.com

代码

web_reg_save_param_ex();

输出日志

//Retrieving the first value.
//c_FirstValue will retrieve the string 'established'


web_reg_save_param_ex(
    "ParamName=c_FirstValue",
    "LB=This domain is",
    "RB=to be used",
    "Ordinal=1",
    SEARCH_FILTERS,
    LAST);

web_custom_request("web_custom_request",
    "URL=https://www.example.com",
    "Method=GET",
    "TargetFrame=",
    "Resource=0",
    "Referer=",
    "Body=",
    LAST);

lr_output_message("%s",lr_eval_string("{c_FirstValue}"));

//In this function, we are passing the c_FirstValue as a left boundary and retrieves the string 'to'

web_reg_save_param_ex(
    "ParamName=c_SecondValue",
    "LB={c_FirstValue}",
    "RB=be used",
    "Ordinal=1",
    SEARCH_FILTERS,
    LAST);

web_custom_request("web_custom_request",
    "URL=https://www.example.com",
    "Method=GET",
    "TargetFrame=",
    "Resource=0",
    "Referer=",
    "Body=",
    LAST);

lr_output_message("%s",lr_eval_string("{c_SecondValue}"));