51Testing软件测试论坛
标题:
lr录制脚本后关联后并发测试不成功
[打印本页]
作者:
ontheroad
时间:
2009-2-19 15:25
标题:
lr录制脚本后关联后并发测试不成功
我录制了一个申请页面的脚本,“申请”提交后,数据会去到“审核”页面,脚本中首先关联了登录用户,然后手动关联domain.customer.id的值(客户名称),domain.customer.code(客户代码),orgInfo.shortName(客户简称),因为每张申请单的这些数据都不一样,在脚本中设置了事务和集合点后并发测试,发现在“审核”页面并没有产生数据!脚本回放没有错误,但是在我没有做手动关联之前却可以在“审核”页面产生数据,这些数据每一条都是一样的,这不符合业务的规则,现在我把手动关联前的脚本贴出来,请高手们帮忙分析一下,先谢谢各位了
作者:
ontheroad
时间:
2009-2-19 15:27
Action()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 6
// {JSESSIONID3} = "CCE6FFC145DD82A038219E777436FB80"
// */
web_reg_save_param("JSESSIONID3",
"LB/IC=jsessionid=",
"RB/IC=\"",
"Ord=1",
"RelFrameId=1",
"Search=body",
LAST);
// [WCSPARAM WCSParam_Diff1 32 CCE6FFC145DD82A038219E777436FB80] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param("WCSParam_Diff1",
"LB=jsessionid=",
"RB=\"",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
web_url("login.action",
"URL=http://192.168.21.170:8080/eShoes/login.action",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=css/menu.css", ENDITEM,
"URL=css/fullcontainer.css", ENDITEM,
"URL=struts/dojo/src/debug.js", ENDITEM,
"URL=struts/dojo/src/browser_debug.js", ENDITEM,
"URL=js/comresource/common/Core.js", ENDITEM,
"URL=js/comresource/util/Browser.js", ENDITEM,
"URL=js/comresource/util/Css.js", ENDITEM,
"URL=js/comresource/util/Dom.js", ENDITEM,
"URL=js/comresource/buttonBar/ButtonBar.js", ENDITEM,
"URL=js/comresource/editor/Editor.js", ENDITEM,
"URL=img/middle.jpg", ENDITEM,
"URL=js/comresource/editor/TextEditor.js", ENDITEM,
"URL=img/eshoes/input/text-bg.gif", ENDITEM,
LAST);
web_submit_data("LoginAction.action;jsessionid={WCSParam_Diff1}",
"Action=http://192.168.21.170:8080/eShoes/common/LoginAction.action;jsessionid={JSESSIONID3}",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.21.170:8080/eShoes/login.action",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=loginName", "Value=jacky", ENDITEM,
"Name=loginName.editor", "Value=jacky", ENDITEM,
"Name=password", "Value=123", ENDITEM,
EXTRARES,
作者:
ontheroad
时间:
2009-2-19 15:29
Action()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 6
// {JSESSIONID3} = "CCE6FFC145DD82A038219E777436FB80"
// */
web_reg_save_param("JSESSIONID3",
"LB/IC=jsessionid=",
"RB/IC=\"",
"Ord=1",
"RelFrameId=1",
"Search=body",
LAST);
// [WCSPARAM WCSParam_Diff1 32 CCE6FFC145DD82A038219E777436FB80] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param("WCSParam_Diff1",
"LB=jsessionid=",
"RB=\"",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
web_url("login.action",
"URL=http://192.168.21.170:8080/eShoes/login.action",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=css/menu.css", ENDITEM,
"URL=css/fullcontainer.css", ENDITEM,
"URL=struts/dojo/src/debug.js", ENDITEM,
"URL=struts/dojo/src/browser_debug.js", ENDITEM,
"URL=js/comresource/common/Core.js", ENDITEM,
"URL=js/comresource/util/Browser.js", ENDITEM,
"URL=js/comresource/util/Css.js", ENDITEM,
"URL=js/comresource/util/Dom.js", ENDITEM,
"URL=js/comresource/buttonBar/ButtonBar.js", ENDITEM,
"URL=js/comresource/editor/Editor.js", ENDITEM,
"URL=img/middle.jpg", ENDITEM,
"URL=js/comresource/editor/TextEditor.js", ENDITEM,
"URL=img/eshoes/input/text-bg.gif", ENDITEM,
LAST);
web_submit_data("LoginAction.action;jsessionid={WCSParam_Diff1}",
"Action=http://192.168.21.170:8080/eShoes/common/LoginAction.action;jsessionid={JSESSIONID3}",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.21.170:8080/eShoes/login.action",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=loginName", "Value=jacky", ENDITEM,
"Name=loginName.editor", "Value=jacky", ENDITEM,
"Name=password", "Value=123", ENDITEM,
EXTRARES,
。。。。。。。(这段是登录的,太多省略了)
"URL=../img/struts2/info.png", "Referer=http://192.168.21.170:8080/eShoes/main.jsp", ENDITEM,
LAST);
lr_think_time(2);
作者:
ontheroad
时间:
2009-2-19 15:29
web_url("MenuMapServlet",
"URL=http://192.168.21.170:8080/eShoes/MenuMapServlet?id=-30",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.21.170:8080/eShoes/main.jsp",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
lr_think_time(2);
web_url("SaleCustomerApplyPrepareAction.action",
"URL=http://192.168.21.170:8080/eShoes/build/customerbuild/SaleCustomerApplyPrepareAction.action",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.21.170:8080/eShoes/main.jsp",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"URL=/eShoes/struts/dojo/src/debug.js", ENDITEM,
"URL=/eShoes/struts/dojo/src/browser_debug.js", ENDITEM,
"URL=/eShoes/js/comresource/common/Core.js", ENDITEM,
"URL=/eShoes/js/comresource/util/Browser.js", ENDITEM,
"URL=/eShoes/js/comresource/util/Css.js", ENDITEM,
"URL=/eShoes/js/comresource/util/Dom.js", ENDITEM,
"URL=/eShoes/js/comresource/buttonBar/ButtonBar.js", ENDITEM,
"URL=/eShoes/js/comresource/editor/Editor.js", ENDITEM,
"URL=/eShoes/img/toolbar/save.gif", ENDITEM,
"URL=/eShoes/img/toolbar/reset.gif", ENDITEM,
"URL=/eShoes/js/comresource/editor/TextEditor.js", ENDITEM,
"URL=/eShoes/img/toolbar/submit.gif", ENDITEM,
"URL=/eShoes/img/eshoes/button/btn-sprite.gif", ENDITEM,
"URL=/eShoes/js/comresource/editor/NumberEditor.js", ENDITEM,
"URL=/eShoes/js/comresource/editor/NumberFormat.js", ENDITEM,
"URL=/eShoes/js/comresource/editor/MoneyEditor.js", ENDITEM,
"URL=getCustomerOrganization.action?domain.organization.id=21", ENDITEM,
"URL=getOrganization.action?domain.organization.id=200004", ENDITEM,
LAST);
lr_think_time(45);
web_submit_data("SaleCustomerApplyAction.action",
"Action=http://192.168.21.170:8080/eShoes/build/customerbuild/SaleCustomerApplyAction.action",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.21.170:8080/eShoes/build/customerbuild/SaleCustomerApplyPrepareAction.action",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=domain.customerTypeId", "Value=100", ENDITEM,
"Name=domain.organization.id", "Value=21", ENDITEM,
"Name=domain.customer.id", "Value=200004", ENDITEM,
"Name=domain.customer.code", "Value=q", ENDITEM,
"Name=domain.customer.code.editor", "Value=q", ENDITEM,
"Name=orgInfo.shortName", "Value=q", ENDITEM,
"Name=orgInfo.shortName.editor", "Value=q", ENDITEM,
"Name=orgInfo.juridicalPerson", "Value=", ENDITEM,
"Name=orgInfo.juridicalPerson.editor", "Value=", ENDITEM,
"Name=orgInfo.taxNo", "Value=", ENDITEM,
"Name=orgInfo.taxNo.editor", "Value=", ENDITEM,
"Name=orgInfo.taxpayerTypeId", "Value=100", ENDITEM,
"Name=orgInfo.contactMan", "Value=a", ENDITEM,
"Name=orgInfo.contactMan.editor", "Value=a", ENDITEM,
"Name=orgInfo.tel", "Value=123456", ENDITEM,
"Name=orgInfo.tel.editor", "Value=123456", ENDITEM,
"Name=orgInfo.postalCode", "Value=", ENDITEM,
"Name=orgInfo.postalCode.editor", "Value=", ENDITEM,
"Name=orgInfo.consignee", "Value=", ENDITEM,
"Name=orgInfo.consignee.editor", "Value=", ENDITEM,
"Name=orgInfo.deliverCompany", "Value=", ENDITEM,
"Name=orgInfo.deliverCompany.editor", "Value=", ENDITEM,
"Name=orgInfo.enrolAddress", "Value=天河", ENDITEM,
"Name=orgInfo.enrolAddress.editor", "Value=天河", ENDITEM,
"Name=orgInfo.defaultDeliverAddress", "Value=", ENDITEM,
"Name=orgInfo.defaultDeliverAddress.editor", "Value=", ENDITEM,
"Name=orgInfo.payee", "Value=", ENDITEM,
"Name=orgInfo.payee.editor", "Value=", ENDITEM,
"Name=domain.natureType.id", "Value=1", ENDITEM,
"Name=domain.propertyId", "Value=100", ENDITEM,
"Name=domain.collaborationType.id", "Value=5", ENDITEM,
"Name=domain.grade.id", "Value=2", ENDITEM,
"Name=domain.paymentMethodId", "Value=200", ENDITEM,
"Name=domain.areaManage.id", "Value=3", ENDITEM,
"Name=domain.taxTypeId", "Value=100", ENDITEM,
"Name=domain.bank", "Value=", ENDITEM,
"Name=domain.bank.editor", "Value=", ENDITEM,
"Name=domain.accountName", "Value=", ENDITEM,
"Name=domain.accountName.editor", "Value=", ENDITEM,
"Name=domain.bankAccount", "Value=", ENDITEM,
"Name=domain.bankAccount.editor", "Value=", ENDITEM,
"Name=customerCredit.days", "Value=3", ENDITEM,
"Name=customerCredit.days.editor", "Value=3", ENDITEM,
"Name=customerCredit.credit", "Value=500", ENDITEM,
"Name=customerCredit.credit.editor", "Value=500", ENDITEM,
"Name=customerCredit.creditTypeId", "Value=100", ENDITEM,
"Name=customerCredit.remainingValue", "Value=0", ENDITEM,
"Name=customerCredit.remainingValue.editor", "Value=0.00", ENDITEM,
"Name=orgInfo.consignCompanyName", "Value=", ENDITEM,
"Name=orgInfo.consignCompanyName.editor", "Value=", ENDITEM,
"Name=orgInfo.consignCompanyAddr", "Value=", ENDITEM,
"Name=orgInfo.consignCompanyAddr.editor", "Value=", ENDITEM,
"Name=domain.createUser.name", "Value=Jacky", ENDITEM,
"Name=domain.createUser.name.editor", "Value=Jacky", ENDITEM,
"Name=domain.createUser.id", "Value=11686", ENDITEM,
"Name=domain.createDate", "Value=2009-02-19", ENDITEM,
"Name=domain.createDate.editor", "Value=2009-02-19", ENDITEM,
"Name=submitType", "Value=submit", ENDITEM,
EXTRARES,
"URL=/eShoes/struts/dojo/src/debug.js", ENDITEM,
"URL=/eShoes/struts/dojo/src/browser_debug.js", ENDITEM,
"URL=/eShoes/js/comresource/common/Core.js", ENDITEM,
"URL=/eShoes/js/comresource/util/Browser.js", ENDITEM,
"URL=/eShoes/js/comresource/util/Css.js", ENDITEM,
"URL=/eShoes/js/comresource/util/Dom.js", ENDITEM,
"URL=/eShoes/js/comresource/buttonBar/ButtonBar.js", ENDITEM,
"URL=/eShoes/js/comresource/editor/Editor.js", ENDITEM,
"URL=/eShoes/js/comresource/editor/TextEditor.js", ENDITEM,
LAST);
return 0;
}
作者:
ontheroad
时间:
2009-2-19 15:40
高手们过来指点指点啊,急
作者:
adiao
时间:
2009-2-19 16:38
domain.customer.id的值(客户名称),domain.customer.code(客户代码),orgInfo.shortName(客户简称)
应该是参数化而不是用关联吧
另外系统是否允许同一个账号同时登录并同时操作,如果不支持,那么
"Name=loginName", "Value=jacky", ENDITEM,
"Name=loginName.editor", "Value=jacky", ENDITEM,
"Name=password", "Value=123", ENDITEM,
这段也该参数化
作者:
chare
时间:
2009-2-19 21:04
看完你的代码。感觉怎么怪怪的。
请教下
web_set_max_html_param_len("1024");
你这句话在脚本中起什么作用
Sets the maximum length of any HTML string that can be retrieved and saved as a parameter.
有必要这样定义吗?
作者:
ontheroad
时间:
2009-2-25 21:30
标题:
回复 6# 的帖子
谢谢!前段时间有事了,不好意思,domain.customer.id的值(客户名称),domain.customer.code(客户代码),orgInfo.shortName(客户简称)只进行参数化也不可以,上面的脚本对用户已经进行了关联
作者:
ontheroad
时间:
2009-2-25 21:56
标题:
回复 7# 的帖子
web_set_max_html_param_len("1024");只是想增加参数的大小
作者:
ontheroad
时间:
2011-7-13 11:35
偶然发现刚做性能测试时发过的帖子,这个问题早已经解决,解决办法是对关联语句中的Ord做参数化
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2