loadrunner之webHttp脚本的各种关联写法

1.关联写法(使用正则方式,将左边界写死)

 loadrunner之webHttp脚本的各种关联写法_第1张图片

web_reg_save_param_ex(
        "ParamName=visitid",
        "LB/RE=,62,6,61,\"",
        "RB=\"",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

2.关联写法(使用正则方式,将右边界写死) 

loadrunner之webHttp脚本的各种关联写法_第2张图片

web_reg_save_param_ex(
        "ParamName=visitid",
        "LB=,\"",
        "RB/RE=\",31,66",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

3.关联写法(使用正则方式,将左右边界都写死) 

loadrunner之webHttp脚本的各种关联写法_第3张图片

web_reg_save_param_ex(
        "ParamName=visitid",
        "LB=,62,6,61,\"",
        "RB/RE=\",31,66",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

4..关联写法(左边界定义参数名,未使用正则,未转码)

loadrunner之webHttp脚本的各种关联写法_第4张图片

web_reg_save_param_ex(
        "ParamName=reqseq",
        "LB=,\"regSequence\",\"",
        "RB=\"",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

5.关联写法(右边界定义参数名,未使用正则,未转码)

loadrunner之webHttp脚本的各种关联写法_第5张图片

web_reg_save_param_ex(
        "ParamName=reqseq",
        "LB=,\"",
        "RB=\",\"visitEndDate\",",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

6.关联写法(使用正则,多匹配,且定义取值的长度)

loadrunner之webHttp脚本的各种关联写法_第6张图片

 web_reg_save_param_ex(
        "ParamName=orderIdyf",
        "LB/RE=,118,14[4-6],\"",    
        "RB=\",",  
        SEARCH_FILTERS,
        "SaveLen=4",
        "Scope=Body",
        LAST);

7.关联写法(指定取最后一个出现的此参数值)

loadrunner之webHttp脚本的各种关联写法_第7张图片

web_reg_save_param_ex(
        "ParamName=prescDetailid",
        "LB/RE=,16[6-7],7,0,8[5-6],7,\"",
        "RB=\",",
        "Ordinal=LAST",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

8.关联写法(正则匹配单据号)

例如单据号为:"02A201906-1400006"

web_reg_save_param_ex(
        "ParamName=id",
        "LB/RE=,\"[A-Z0-9]{7}-[0-9]{9}\"",
        "RB=,",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

9.关联写法(左边界为动态参数,内容为,\"{zyys}\",\"或者prescNo\",\")

    web_reg_save_param_ex(
           "ParamName=jyapplyno",
            "LB/RE=,\"{zyys}\",\"|prescNo\",\"",
            "RB=\"",
             SEARCH_FILTERS,
             "Scope=Body",
             LAST);

10.关联写法(取到返回的已定义边界的所有值),例如同一个字段有多个值,就全取出来,写法( "Ordinal=all",),用的时候使用数组方式使用,如果取出两个值,可以prescDetailid_1,prescDetailid_2,以此类推

web_reg_save_param_ex(
        "ParamName=prescDetailid",
        "LB/RE=,16[6-9],7,0,8[5-6],7,\"",
        "RB=\",",
        "Ordinal=all",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST);

 

你可能感兴趣的:(测试)