测试小农 发表于 2017-3-27 14:20:58

loadrunner 进行接口测试怎么接收并调用返回的值进行下一个页面的测试

web_custom_request("maintcalendar",
"URL=http://beta.tk.api.yixiuche.com/ac/car/maintcalendaraccess_token=3ea44bd36d49e8f4a55f54482uk3f04c",
"Method=POST",
"Resource=0",
//"RecContentType=application/json",
"Referer=",
   "Mode=HTTP"
//"EncType=application/json",
"Body={\"car_license\":\"{car_license_var}\",\"tk_user_openid\":\"{{tk_user_openid}}\",\"car_enginenumber\":\"{{car_engineumber}}\","
"\"car_engineversion\":\"{{car_engineversion}}\",\"car_vin\":\"{{car_vin}}\",\"car_roaddate\":\"{{car_roaddate}}\",\"car_currentmileage\":\"{{car_currentmileage}}\","
"\"car_brandname\":\"car_brandname_var\",\"car_seriesname\":\"{{car_seriesname}}\",\"car_year\":\"{{car_year}}\",\"car_engine\":\"{{car_engine}}\",\"car_engine_unit\":\"{{car_engine_unit}}\","
"\"car_trans\":\"{{car_trans}}\",\"car_version\":\"{car_version_var}\",\"car_carriage\":\"{{car_carriage}}\",\"car_transmission \":\"{car_transmission_var}\",\"car_power \":\"{car_power_var}\","
"\"car_frontbraketype\":\"{car_frontbraketype_var}\",\"car_carbody\":\"{car_carbody_var}\"}",
                        LAST);
                                return 0;
                                }

这是我的代码

测试小农 发表于 2017-3-27 14:22:02

"http://beta.tk.api.yixiuche.com/ac/car/maintcalendar?access_token=3ea44bd36d49e8f4a55f54482uk3f04c" 的 t=1189ms: 384 个字节响应标头 (RelFrameId=1, Internal ID=1)
Action.c(29):   HTTP/1.1 200 OK\r\n
Action.c(29):   Date: Mon, 27 Mar 2017 06:16:24 GMT\r\n
Action.c(29):   Server: Apache/2.2.22 (Ubuntu)\r\n
Action.c(29):   X-Powered-By: PHP/5.3.10-1ubuntu3.18\r\n
Action.c(29):   Status: 200\r\n
Action.c(29):   Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n
Action.c(29):   Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\n
Action.c(29):   Pragma: no-cache\r\n
Action.c(29):   Content-Length: 145\r\n
Action.c(29):   Keep-Alive: timeout=5, max=100\r\n
Action.c(29):   Connection: Keep-Alive\r\n
Action.c(29):   Content-Type: application/json; charset=utf-8\r\n
Action.c(29):   \r\n
Action.c(29): "http://beta.tk.api.yixiuche.com/ac/car/maintcalendar?access_token=3ea44bd36d49e8f4a55f54482uk3f04c" 的 t=1284ms: 145 个字节响应正文 (RelFrameId=1, Internal ID=1)
Action.c(29):   {"status":0,"errcode":"10006","errmsg":"invalid car_roaddate","content":{"car_maintcalenda
Action.c(29):   r_url":"http:\\/\\/beta.tk.m.yixiuche.com\\/yv\\/ncBjonG"}}
Action.c(29): web_custom_request("maintcalendar") 已成功,145 个正文字节,384 个标头字节       
正在结束操作 Action。




这个是日志信息

测试小农 发表于 2017-3-27 14:33:54

我想调用返回的url 进行测试 请问怎么调用啊

szyszy2000 发表于 2017-3-28 14:37:24

使用手工关联
利用web_reg_save_param函数截取请求返回值,存入变量,在下次请求使用
页: [1]
查看完整版本: loadrunner 进行接口测试怎么接收并调用返回的值进行下一个页面的测试