Loadrunner 接口依赖测试

时间:2021-07-31 14:33:32
Action()
{

    //利用关联获取第一个GET请求的返回XXX字段的值,并存储到response_XXX变量中。
    web_reg_save_param_ex(
        "ParamName=response_XXX",
        "LB=\"XXX\":\""
        "RB=\"",
        SEARCH_FILTERS,
        LAST);

    //第一个GET请求
    web_url("web_url",
        "URL=https://www.baidu.com",
        "TargetFrame=",
        "Resource=0",
        "Referer=",
        LAST);

    //把第一个GET请求返回的response_XXX变更赋值给comment字段
    web_submit_data("web_submit_data",
        "URL=http://www.baidu.com/v1/log/comment",
        "Body=log_id=1&detail_id=1&comment={response_XXX}",
        "Method=POST",
        "TargetFrame=",
        "Referer=",
        ITEMDATA,
        LAST);

    ;
}