求助:这个地方是否应该做关联。
最近要用loadrunner做性能测试。屡试屡败,坎坷万分。现在有个问题:登录进去后,提示。无权限显示页面内容。录制两次的代码如下(登录内容省略):第一次:
web_submit_data("troubleReg_getA4Result.action", "Action=http://10.0.52.49:5000/caqc/troubleReg/troubleReg_getA4Result.action?_dc=1340762711640",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.0.52.49:5000/caqc/caqc/dist_A4.jsp",
"Snapshot=t7.inf",
"Mode=HTML",
ITEMDATA,
"Name=start", "Value=0", ENDITEM,
"Name=strdtlid", "Value=", ENDITEM,
"Name=tshowmodeid", "Value=", ENDITEM,
LAST);
第二次:web_submit_data("troubleReg_getA4Result.action",
"Action=http://10.0.52.49:5000/caqc/troubleReg/troubleReg_getA4Result.action?_dc=1340776150812",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.0.52.49:5000/caqc/caqc/dist_A4.jsp",
"Snapshot=t7.inf",
"Mode=HTML",
ITEMDATA,
"Name=start", "Value=0", ENDITEM,
"Name=strdtlid", "Value=", ENDITEM,
"Name=tshowmodeid", "Value=", ENDITEM,
LAST);
发现两次不同的只有:第一句中。Action=http://10.0.52.49:5000/caqc/troubleReg/troubleReg_getA4Result.action?_dc=1340776150812", 让开发人员查了代码,发现只有没有_dc.没有找见1340776150812这个数据是从哪里来的。各位高手能给我这个初学者个提醒么。谢谢了。 1340776150812 应该是要做关联的,你可以试一下 要关联 为什么要省略掉登录内容?
感觉你要关联的东西在登录页面的服务器返回信息中 打那个电话问一下,突然发现它是13个数。
5楼说得到,还有,要web_reg_save_param()一下。呵呵。 默认情况下lr自动做关联,这个Action=http://10.0.52.49:5000/caqc/troubleReg/troubleReg_getA4Result.action?_dc=1340776150812",明显是接口调用,发送的数据给这个接口的参数 你可以问一下开发,应该有指定信息的参数,需要做关联的。 回复 7# 51Xiaolin
我也认为是,开发人员找了好久也么有找见这个参数。 char hashpass,lasspass;
char originpass = "C4CA4238A0B923820DCC509A6F75849B";
char*pass;
char strpass="Value=";
Action()
{
// Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param( "WCSParam_Diff1", "LB= hex_md5(hashone+'", "RB='", "Ord=1", "Search=Body", "RelFrameId=1", LAST );
web_url("caqc",
"URL=http://10.0.52.49:5000/caqc/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=resources/greybox/header_bg.gif", ENDITEM,
"Url=resources/greybox/w_close.gif", ENDITEM,
"Url=resources/greybox/g_close.gif", ENDITEM,
"Url=resources/greybox/indicator.gif", ENDITEM,
LAST);
web_url("My97DatePicker.htm",
"URL=http://10.0.52.49:5000/caqc/resources/DatePicker/My97DatePicker.htm",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.0.52.49:5000/caqc/",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=lang/zh-cn.js", ENDITEM,
"Url=skin/default/datepicker.css", ENDITEM,
"Url=skin/whyGreen/datepicker.css", ENDITEM,
"Url=skin/default/img.gif", ENDITEM,
LAST);
sprintf(hashpass,"%s" ,lr_eval_string("{WCSParam_Diff1}"));
strcat(originpass,hashpass);
GetMd5FromString(originpass,lasspass);
pass = (char *)strupr(&lasspass);
strcat(strpass,pass);
web_submit_data("login_login.action",
"Action=http://10.0.52.49:5000/caqc/login_login.action",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.0.52.49:5000/caqc/",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=j_username", "Value=test35", ENDITEM,
"Name=url", "Value=/caqc/dist_A4.jsp", ENDITEM,
"Name=j_password", strpass, ENDITEM,
"Name=hash", "Value={WCSParam_Diff1}", ENDITEM,
"Name=domainId", "Value=caqc", ENDITEM,
EXTRARES,
"Url=resources/ext2/resources/images/default/s.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tree/folder.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/panel/white-top-bottom.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/toolbar/bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/grid-blue-split.gif", ENDITEM,
"Url=resources/images/button_portal2.gif", ENDITEM,
"Url=resources/images/button_tabs.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/toolbar/btn-arrow.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tab-strip-btm-bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tab-btm-left-bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tab-btm-right-bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tab-btm-inactive-right-bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tab-btm-inactive-left-bg.gif", ENDITEM,
"Url=resources/images/button_nav1.png", ENDITEM,
"Url=resources/ext2/resources/images/default/panel/tool-sprites.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/panel/light-hd.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tab-strip-bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tabs/tabs-sprite.gif", ENDITEM,
"Url=resources/images/button_search.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/layout/mini-bottom.gif", ENDITEM,
"Url=resources/images/button_flow.gif", ENDITEM,
"Url=resources/images/button_exp.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/page-first-disabled.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/page-prev-disabled.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/page-next-disabled.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/page-last-disabled.gif", ENDITEM,
"Url=resources/images/button_help.gif", ENDITEM,
"Url=resources/images/button_signout.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tree/elbow-end-plus.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/grid3-hrow.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/row-check-sprite.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/grid3-hd-btn.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/dd/drop-no.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/col-move-top.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/col-move-bottom.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/grid3-hrow-over.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/sort_desc.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/panel/left-right.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/panel/corners-sprite.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/panel/top-bottom.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/button/btn-sprite.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/form/text-bg.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/form/date-trigger.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/box/tb-blue.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/tree/leaf.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/done.gif", ENDITEM,
"Url=resources/ext2/resources/images/default/grid/grid3-special-col-sel-bg.gif", ENDITEM,
LAST);
web_custom_request("appTroubleregManager.getTroubleregSize.dwr",
"URL=http://10.0.52.49:5000/caqc/dwr/call/plaincall/appTroubleregManager.getTroubleregSize.dwr",
"Method=POST",
"Resource=1",
"RecContentType=text/javascript",
"Referer=http://10.0.52.49:5000/caqc/login_login.action",
"Snapshot=t4.inf",
"EncType=text/plain",
"Body=callCount=1\npage=/caqc/login_login.action\nhttpSessionId=\nscriptSessionId=${scriptSessionId}520\nc0-scriptName=appTroubleregManager\nc0-methodName=getTroubleregSize\nc0-id=0\nbatchId=0\n",
LAST);
web_custom_request("appTroubleregManager.getA1Size.dwr",
"URL=http://10.0.52.49:5000/caqc/dwr/call/plaincall/appTroubleregManager.getA1Size.dwr",
"Method=POST",
"Resource=1",
"RecContentType=text/javascript",
"Referer=http://10.0.52.49:5000/caqc/login_login.action",
"Snapshot=t5.inf",
"EncType=text/plain",
"Body=callCount=1\npage=/caqc/login_login.action\nhttpSessionId=\nscriptSessionId=${scriptSessionId}520\nc0-scriptName=appTroubleregManager\nc0-methodName=getA1Size\nc0-id=0\nbatchId=1\n",
LAST);
web_submit_data("troubleReg_getA4Result.action",
"Action=http://10.0.52.49:5000/caqc/troubleReg/troubleReg_getA4Result.action?_dc=1341217282442",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.0.52.49:5000/caqc/login_login.action",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=start", "Value=0", ENDITEM,
"Name=strdtlid", "Value=", ENDITEM,
"Name=tshowmodeid", "Value=", ENDITEM,
LAST);
return 0;
}
这是所有的登录录制代码。其中我们用了加密方法,用到获取hash值,我已经自动获取了。且我们系统的后台,已经显示此用户登录。但是lr就是报错。错误如下:
ction.c(43): Error -26627: HTTP Status-Code=404 (/caqc/embed/alert.jsp) for "http://10.0.52.49:5000/caqc/embed/alert.jsp"
Action.c(43): Warning -26627: HTTP Status-Code=404 (/caqc/black) for "http://10.0.52.49:5000/caqc/black"
Action.c(43): web_submit_data("login_login.action") highest severity level was "ERROR", 283284 body bytes, 18514 header bytes, 168 chunking overhead bytes
Ending action Action.
且run-timer viewer 报: 找到问题所在了。谢谢大家。dc=1340776150812 是获取系统时间,精确到毫秒级的。谢谢大家, 各位高手啊,我把这个设置关联了。用lr系统默认函数web_save_timestamp_param("tStamp", LAST);获取系统毫秒级时间,但是仍然错误。再帮帮忙看下吧。继续学习中。 会不会是你关联的函数本身是错误的呢?? 获取系统当前时间也需要关联吗? 在VUGen的Tools->Recording Options下的Recoding分支中,
将HTML-based script的单选按钮改为URL-based script
再录制脚本,运行脚本 强烈表示关注,正在学习关联中... 回复 15# yinxiaodan
谢谢哦。换一种录制方式就把问题解决了。真是峰会路转呢。 回复 17# a16liu
呵呵,我猜你们的页面用到了ajax
页:
[1]