LoadRunner 接口测试
作者:网络转载 发布时间:[ 2014/7/29 9:03:22 ] 推荐标签:性能测试工具
Action1()
{
int i;
lr_rendezvous("rend");
lr_start_transaction("get");
for(i=0;i<11;i++)
{
web_url("get",
"URL=http://{urlparam}",
"Resource=1",
"RecContentType=application/json",
"Referer=",
"Snapshot=t1.inf",
LAST);
}
lr_end_transaction("get", LR_AUTO);
lr_start_transaction("post");
web_submit_data("post",
"Action=http://api.zjol.com.cn/api/user_feedback",
"Method=POST",
"RecContentType=text/html",
"Mode=HTML",
ITEMDATA,
"Name=session_id", "Value=4f59d9d14d405ae7367544af", ENDITEM,
"Name=title", "Value=test_title", ENDITEM,
"Name=content", "Value=test data", ENDITEM,
LAST);
web_submit_data("jpost",
"Action=http://api.zjol.com.cn/api/client_log/batch",
"Method=POST",
"RecContentType=application/json",
"Mode=HTML",
ITEMDATA,
"Name=session_id", "Value=4f59d9d14d405ae7367544af", ENDITEM,
"Name=is_test", "Value=false", ENDITEM,
"Name=logs", "Value=[{"local_time":1395051006337,"log_level":1,"op_place":0,"op_type":4001},{"local_time":1395051094555,"log_level":1,"op_place":0,"op_type":4002},{"local_time":1395051115432,"log_level":1,"op_place":0,"op_type":4001},{"local_time":1395051132291,"log_level":1,"op_place":0,"op_target":"52e5f902cf81d754a434fb52","op_type":2004},{"local_time":1395051147817,"log_level":1,"op_place":0,"op_type":5000}]", ENDITEM,
LAST);
lr_end_transaction("post", LR_AUTO);
return 0;
}
都用了web_submit_data函数,包括存在JSON数据,都能实现。 用web_custom_request函数没成功过。
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11