4)两种脚本的内容比较:
* http脚本直观,易于理解和维护
* url 内容多,可伸缩性强,记录了更详细的用户操作信息。
2,HTML 高级选项:
1) 默认是选择描述用户行为的脚本
2) 仅包含明确的URL脚本,录制结果如下:
Action()
{
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_url("Update.htm",
"URL=http://scdown.qq.com/download/Update.htm",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
web_url("Update.htm_2",
"URL=http://scdown.qq.com/download/Update.htm",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
web_url("Update.htm_3",
"URL=http://scdown.qq.com/download/Update.htm",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=97276.9197245848fAADziVpffiDDDDDDAAccpAiQDf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=52", ENDITEM,
"Name=login.y", "Value=8", ENDITEM,
LAST);
return 0;
}
3,录制header
默认设置是不录制,选择需要录制的Headers,以便服务器能够正确处理编码信息。需要注意的是“accept-language”,像websphere这类服务器会根据HTTP 请求中的Header来确定编码。
文章来源于领测软件测试网 https://www.ltesting.net/