51Testing软件测试论坛
标题:
为什么脚本单独回放能成功,放到action里面作为事件块的一部分就回放失败?
[打印本页]
作者:
pixiu1999
时间:
2013-3-21 14:50
标题:
为什么脚本单独回放能成功,放到action里面作为事件块的一部分就回放失败?
最近在对论坛做一个性能测试 :场景是用户登陆后40%概率浏览,30%概率发帖,20%概率回帖,10%概率搜索。
其中前三个场景的脚本是前天在自己本机录制,搜索的脚本今天录制的时候,出现了无法录制的问题,不知道怎么解决。
结果就在同事的机子上进行录制搜索(直接以游客身份录制的,未登录),录制完以后,脚本拷贝到我的机器上,回放可以成功(脚本如下)。
但是当将这个脚本拷贝到场景中block-〉search下面时,回放就报错了(从用户登录开始回放,其他事件概率设置为零,搜索设置为100%),提示说表单没找到。
Action()
{
web_url("frame.html",
"URL=http://10.50.107.9:8090/portal/frame.html?module=frame&action=frame",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
// EXTRARES,
// "Url=templates/default/styles/style.css?1363168207711", "Referer=http://10.50.107.9:8090/portal/forums/list.html", ENDITEM,
// "Url=templates/default/images/menu_bg.gif", "Referer=http://10.50.107.9:8090/portal/templates/default/styles/style.css?1363168207711", ENDITEM,
// "Url=templates/default/images/menu_line.gif", "Referer=http://10.50.107.9:8090/portal/templates/default/styles/style.css?1363168207711", ENDITEM,
// "Url=templates/default/images/header_bg.gif", "Referer=http://10.50.107.9:8090/portal/templates/default/styles/style.css?1363168207711", ENDITEM,
// "Url=templates/default/images/box_bg.gif", "Referer=http://10.50.107.9:8090/portal/templates/default/styles/style.css?1363168207711", ENDITEM,
LAST);
// lr_think_time(4);
web_link("搜索",
"Text=搜索",
"Snapshot=t2.inf",
EXTRARES,
"Url=../templates/default/styles/style.css?1363168207711", ENDITEM,
LAST);
lr_think_time(1);
lr_rendezvous("jihedian");
lr_start_transaction("sousuo");
web_submit_form("jforum.html",
"Snapshot=t3.inf",
ITEMDATA,
"Name=search_keywords", "Value={keywords}", ENDITEM,
"Name=match_type", "Value=all", ENDITEM,
"Name=search_forum", "Value=所有的", ENDITEM,
"Name=sort_by", "Value=关联性", ENDITEM,
LAST);
// lr_think_time(1);
lr_end_transaction("sousuo", LR_AUTO);
lr_think_time(1);
web_find("web_find",
"What=搜索结果",
LAST);
return 0;
}
---------------报错信息如下
earch.c(17): Detected non-resource "http://10.50.107.9:8090/portal/ping_session.jsp" in "http://10.50.107.9:8090/portal/search/filters.html" [MsgId: MMSG-26574]
search.c(17): web_link("搜索") was successful, 6564 body bytes, 317 header bytes, 13 chunking overhead bytes [MsgId: MMSG-26385]
search.c(27): Rendezvous jihedian
search.c(30): Notify: Transaction "sousuo" started.
search.c(33): Notify: Parameter Substitution: parameter "keywords" = "111"
search.c(33): Error -27979: Requested form not found [MsgId: MERR-27979]
search.c(33): web_submit_form("jforum.html") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
search.c(33): Notify: Transaction "sousuo" ended with "Fail" status (Duration: 0.0498).
Ending action search.
Ending iteration 1.
作者:
真实的追求者
时间:
2013-3-21 15:33
1, 打开recording options,在internet protocol下的recording中选择recording level为HTML-based script,点击HTML Advanced,选择script type为A script containing explicit.
2, 选择使用URL_based script录制。
作者:
pixiu1999
时间:
2013-3-21 22:24
回复
2#
真实的追求者
谢谢 明天试试看
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2