LoadRunner模板一----HTTP模板
Action() {
//配置响应文本长度,当文本长度大于1024时需要进行配置 web_set_max_html_param_len("1024"); web_reg_save_param("response", "LB=", "RB=", LAST); //"message": "SUCCESS", web_reg_save_param("message", "LB=message\":\"", "RB=\"", LAST); lr_start_transaction("search"); web_custom_request("search", "Method=POST", "URL=http://124.71.156.255:8081", "EncType=application/json;charset=utf-8", "Body={\"jsonrpc\":\"2.0\",\"namespace\":\"global\",\"method\":\"block_getBlockByHash\",\"params\":[\"{param}\",false],\"id\":1}", LAST ); if(strcmp(lr_eval_string("{message}"),"SUCCESS")==0){ lr_end_transaction("search",LR_PASS); }else{ lr_end_transaction("search",LR_FAIL); lr_error_message("response:%s",lr_eval_string("{response}")); } return 0; }