web_concurrent_start函数是并发组开始的标记。组中所有的函数是并发执行的,并发组的结束符为web_concurrent_end 函数。
在并发组中,可以包含的函数有:
web_url、web_submit_data、web_custom_request、web_create_html_param、web_create_html_param_ex、web_reg_save_param、web_add_header。
在并发组中的函数不是立即执行的。在并发组开始时,所有的函数首先被记录下来,当并发组结束时,所有的函数并发执行。正因为这样,我们使用的时候要注意,不是所有的函数或代码都可以放到并发组内的,比如lr_output_message函数的调试输出,如果放到并发组内,你将会得到错误的输出(有不少新手都碰到这样的问题,所以有必要在这提出)
web_concurrent_start(NULL); web_url("getWidgetList.do", "URL=http://172.17.2.33:8090/dashboard/getWidgetList.do", "Resource=1", "RecContentType=application/json", "Referer=http://172.17.2.33:8090/starter.html", "Snapshot=t254.inf", LAST); web_reg_save_param("deleteID", "LB={"id":", "RB=,"userId"", "Ord=All", "NotFound=ERROR", LAST); web_reg_save_param("subjectID", "LB="subjectId":"", "RB=",", "Ord=All", "NotFound=ERROR", LAST); web_reg_save_param("responseBody", "LB=", "RB=", "NotFound=ERROR", LAST); web_url("getBoardListNoDelFlag.do", "URL=http://172.17.2.33:8090/dashboard/getBoardListNoDelFlag.do", "Resource=1", "RecContentType=application/json", "Referer=http://172.17.2.33:8090/starter.html", "Snapshot=t255.inf", LAST); web_url("getWidgetList.do_2", "URL=http://172.17.2.33:8090/dashboard/getWidgetList.do", "Resource=1", "RecContentType=application/json", "Referer=http://172.17.2.33:8090/starter.html", "Snapshot=t256.inf", LAST); web_concurrent_end(NULL); lr_output_message("deleteID: %s", lr_eval_string("{deleteID_count}")); lr_output_message("subjectID: %s", lr_paramarr_idx("subjectID",1)); lr_output_message("responseBody: %s", lr_eval_string("{responseBody}"));