一、loadrunner协议分析
协议确定方法
二、提交表单函数的区别
(1)web_sumit_form()
(2)web_sumit_data()
三、web_url和web_link
四、VuGen脚本回放与调试
五、VuGen录制参数设置
六、脚本增强
(1)插入事务
参考代码:
lr_start_transaction("login"); web_submit_data("login.php",
"Action=http://newtours.demoaut.com/login.php",
"Method=POST",
"RecContentType=text/html",
"Referer=http://newtours.demoaut.com/",
"Snapshot=t42.inf",
"Mode=HTTP",
ITEMDATA,
"Name=osCsid", "Value=9ed75e9153b9cb21ff85042cd93335d6", ENDITEM,
"Name=action", "Value=process", ENDITEM,
"Name=userName", "Value=wyl", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=login.x", "Value=22", ENDITEM,
"Name=login.y", "Value=3", ENDITEM,
LAST); lr_end_transaction("login",LR_AUTO);
(2)插入集合点
相关代码:
lr_rendezvous("login"); lr_start_transaction("login"); web_submit_data("login.php",
"Action=http://newtours.demoaut.com/login.php",
"Method=POST",
"RecContentType=text/html",
"Referer=http://newtours.demoaut.com/",
"Snapshot=t43.inf",
"Mode=HTTP",
ITEMDATA,
"Name=osCsid", "Value=b7f96e1104d6557ee10fb8268b8a7e6a", ENDITEM,
"Name=action", "Value=process", ENDITEM,
"Name=userName", "Value=wyl", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=login.x", "Value=28", ENDITEM,
"Name=login.y", "Value=13", ENDITEM,
LAST); web_submit_data("login.php_2",
"Action=http://newtours.demoaut.com/login.php",
"Method=POST",
"RecContentType=text/html",
"Referer=http://newtours.demoaut.com/",
"Snapshot=t44.inf",
"Mode=HTTP",
ITEMDATA,
"Name=osCsid", "Value=b7f96e1104d6557ee10fb8268b8a7e6a", ENDITEM,
"Name=action", "Value=process", ENDITEM,
"Name=userName", "Value=wyl", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=login.x", "Value=28", ENDITEM,
"Name=login.y", "Value=13", ENDITEM,
LAST); lr_end_transaction("login",LR_AUTO);
(3)参数化
参数化之前需要确保脚本可以运行通过
查看参数化变量的输出效果,需要勾选这个选项
(4)关联