loadrunner常用web动作函数
web_custom_request —允许使用任何http请求方法
脚本一:
web_custom_request(“baidu_request”,
“URL=https://www.baidu.com”,
“Method=GET”,
“TargetFrame=”,
“Resource=0”,
“Referer=”,
“Body=”,
LAST);
web_submit_data —执行无条件或无上下文表单提交
脚本二:
web_submit_data(“reservations.pl”,
“Action=http://127.0.0.1:1080/cgi-bin/reservations.pl”,
“Method=POST”,
“TargetFrame=”,
“RecContentType=text/html”,
“Referer=http://127.0.0.1:1080/cgi-bin/reservations.pl?page=welcome”,
“Snapshot=t4.inf”,
“Mode=HTML”,
ITEMDATA,
“Name=advanceDiscount”, “Value=0”, ENDITEM,
“Name=depart”, “Value=Frankfurt”, ENDITEM,
“Name=departDate”, “Value=11/04/2019”, ENDITEM,
“Name=arrive”, “Value=Los Angeles”, ENDITEM,
“Name=returnDate”, “Value=11/05/2019”, ENDITEM,
“Name=numPassengers”, “Value=1”, ENDITEM,
“Name=seatPref”, “Value=Aisle”, ENDITEM,
“Name=seatType”, “Value=Business”, ENDITEM,
“Name=findFlights.x”, “Value=42”, ENDITEM,
“Name=findFlights.y”, “Value=5”, ENDITEM,
“Name=.cgifields”, “Value=roundtrip”, ENDITEM,
“Name=.cgifields”, “Value=seatType”, ENDITEM,
“Name=.cgifields”, “Value=seatPref”, ENDITEM,
LAST);
web_submit_form —模拟表单提交
web_submit_form录制时会判断浏览器中是否有cache的内容,如果有web_submit_form函数中只保存和缓存不相同的数据;
web_submit_data()录制时无需判断浏览器是否有cache,把所有录制的数据都保存在web_submit_data()函数中,例如userSession,SessionId,token等
web_url —get请求url
脚本三:
web_url(“index.htm”,
“URL=http://127.0.0.1:1080/WebTours/index.htm”,
“TargetFrame=”,
“Resource=0”,
“RecContentType=text/html”,
“Referer=”,
“Snapshot=t1.inf”,
“Mode=HTML”,
LAST);