51Testing软件测试论坛

标题: 第一个请求包未录制到,是否手写即可? [打印本页]

作者: 老铁不走一个吗    时间: 2019-1-24 11:29
标题: 第一个请求包未录制到,是否手写即可?
老师你好,今天我在公司尝试了删除操作,录制完脚本后发现总共4个请求包。脚本需要做优化,我的猜测也不知对不对,还请老师给指点下(1)我个人感觉只需要1、3请求包即可,对吗?(2)第一个请求包未录制到,是否手写即可?
lr_start_transaction("删除");

//1、勾选指定删除数据
//F12抓取到包web_url(),但LR未录取到

//2、点击删除按钮
web_submit_data("validate.action",
"Action=http://192.168.5.78/p2m/task/operation/validate.action",
"Method=POST",
"TargetFrame=",
"RecContentType=text/json",
"Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1",
"Snapshot=t30.inf",
"Mode=HTML",
ITEMDATA,
"Name=taskId", "Value=201812070459350003924a2506c150304584a0dc", ENDITEM,
"Name=operationId", "Value=task/operation/logicDeleteTasks", ENDITEM,
"Name=currentMenuId", "Value=2-1-1-1", ENDITEM,
"Name=UUIDTOKEN", "Value=201901081003050005113816cab9592546c89f7b", ENDITEM,
EXTRARES,
"Url=/p2m/uiframe-2.9.6/images/blue/dialog/win_close.jpg", "Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1", ENDITEM,
"Url=/p2m/uiframe-2.9.6/images/blue/dialog/confirm.png", "Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1", ENDITEM,
LAST);

//3、确认删除弹窗
web_submit_data("logicDeleteTasks.action",
"Action=http://192.168.5.78/p2m/task/operation/logicDeleteTasks.action",
"Method=POST",
"TargetFrame=",
"RecContentType=text/json",
"Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1",
"Snapshot=t31.inf",
"Mode=HTML",
ITEMDATA,
"Name=taskId", "Value=201812070459350003924a2506c150304584a0dc", ENDITEM, //删除id
"Name=operationId", "Value=task/operation/logicDeleteTasks", ENDITEM, //??
"Name=currentMenuId", "Value=2-1-1-1", ENDITEM,
"Name=UUIDTOKEN", "Value=201901081003050005113816cab9592546c89f7b", ENDITEM,
EXTRARES,
"Url=/p2m/uiframe-2.9.6/js/syswareui/plugins/jquery-ui-1.9.2.custom/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png", "Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1", ENDITEM,
"Url=/p2m/uiframe-2.9.6/js/syswareui/plugins/jquery-ui-1.9.2.custom/css/ui-lightness/images/ui-icons_228ef1_256x240.png", "Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1", ENDITEM,
LAST);

//4、删除成功浮层提示
web_submit_data("simpleProjectTreeGridList.action_2",
"Action=http://192.168.5.78/p2m/task/grid/data/simpleProjectTreeGridList.action?_time=1546941317947",
"Method=POST",
"TargetFrame=",
"Referer=http://192.168.5.78/p2m/task/grid/view/simpleProjectTreeGridList.simplemesh?currentMenuId=2-1-1-1",
"Snapshot=t32.inf",
"Mode=HTML",
ITEMDATA,
"Name=limit", "Value=20", ENDITEM,
"Name=start", "Value=0", ENDITEM,
"Name=gridId", "Value=simpleProjectTreeGridList", ENDITEM,
"Name=centerId", "Value=-1", ENDITEM,
"Name=id", "Value=7A74DF5AD96E1CDCE0530100007FFA2C", ENDITEM,
"Name=rootId", "Value=7A74DF5AD96E1CDCE0530100007FFA2C", ENDITEM,
"Name=sort", "Value=", ENDITEM,
"Name=dir", "Value=", ENDITEM,
"Name=UUIDTOKEN", "Value=201901081003050005113816cab9592546c89f7b", ENDITEM,
LAST);

lr_end_transaction("删除",LR_AUTO);

return 0;



在学课程:
手写Loadrunner脚本彻底摆脱录制的痛
http://www.atstudy.com/course/572




作者: 学掌门网校    时间: 2019-1-24 11:57
1。删除成功提示的请求,其实可以不需要写了(因为你已经删除成功了,写了只会增大你客户端的压力)

2。我推荐的方法一直是手写脚本啊

如果你的请求录制没录到,你可以跑下脚本,如果数据成功删除(那么那个请求就不是删除必须的)

可以跟开发多沟通,把路径给前端开发(问他们删除接口),他们一看就懂了




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2