|
参数化ID的时候遇到一个问题,希望DX指点一下:
选择http协议录制一个web应用程序,程序中有一个tree,使用js写的,我的操作步骤是:
1 点击item右键菜单中的create case
2 save case
3 右边的树会自动刷新
4 点击case节点
LR录制下来的脚本如下:
/*
* Create a case
*/
// Click create case menu
web_url("addExtras2.do",
"URL=http://172.19.97.109/utms/addExtras2.do?createType=tree&tag=case&itemID=728644",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library",
"Snapshot=t11.inf",
"Mode=HTML",
LAST);
// Save case
web_submit_data("caseModifyFile.do",
"Action=http://172.19.97.109/utms/caseModifyFile.do?worktype=1&intype=designadd&tag=store&selfFresh=true",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/html",
"Referer=http://172.19.97.109/utms/addExtras2.do?createType=tree&tag=case&itemID=728644",
"Snapshot=t12.inf",
"Mode=HTML",
ITEMDATA,
"Name=folder", "Value=", ENDITEM,
"Name=hidType", "Value=", ENDITEM,
"Name=currentProjectID", "Value=0", ENDITEM,
"Name=currentRoundID", "Value=0", ENDITEM,
"Name=itemID", "Value=728644", ENDITEM,
"Name=purposeFileTypeGroup", "Value=", ENDITEM,
"Name=purposeFileSourceGroup", "Value=", ENDITEM,
"Name=purposeFileSizeGroup", "Value=", ENDITEM,
"Name=purposeFileCount", "Value=0", ENDITEM,
"Name=stepFileTypeGroup", "Value=", ENDITEM,
"Name=stepFileSourceGroup", "Value=", ENDITEM,
"Name=stepFileSizeGroup", "Value=", ENDITEM,
"Name=stepFileCount", "Value=0", ENDITEM,
"Name=remarkFileTypeGroup", "Value=", ENDITEM,
"Name=remarkFileSourceGroup", "Value=", ENDITEM,
"Name=remarkFileSizeGroup", "Value=", ENDITEM,
"Name=remarkFileCount", "Value=0", ENDITEM,
"Name=conditionFileTypeGroup", "Value=", ENDITEM,
"Name=conditionFileSourceGroup", "Value=", ENDITEM,
"Name=conditionFileSizeGroup", "Value=", ENDITEM,
"Name=conditionFileCount", "Value=0", ENDITEM,
"Name=expectResultFileTypeGroup", "Value=", ENDITEM,
"Name=expectResultFileSourceGroup", "Value=", ENDITEM,
"Name=expectResultFileSizeGroup", "Value=", ENDITEM,
"Name=expectResultFileCount", "Value=0", ENDITEM,
"Name=caseName", "Value=55", ENDITEM,
"Name=indexCode", "Value=", ENDITEM,
"Name=testType", "Value=ST", ENDITEM,
"Name=casePriority", "Value=high", ENDITEM,
"Name=caseSeverity", "Value=high", ENDITEM,
"Name=baseline", "Value=", ENDITEM,
"Name=relatedComponet", "Value=", ENDITEM,
"Name=testCategory", "Value=", ENDITEM,
"Name=automation", "Value=F", ENDITEM,
"Name=autoExecutableFlag", "Value=", ENDITEM,
"Name=testPurpose", "Value=N/A", ENDITEM,
"Name=hidPurpose", "Value=hidden", ENDITEM,
"Name=purposeFilePath", "Value=", "File=yes", ENDITEM,
"Name=testStep", "Value=N/A", ENDITEM,
"Name=hidStep", "Value=hidden", ENDITEM,
"Name=stepFilePath", "Value=", "File=yes", ENDITEM,
"Name=testRemark", "Value=N/A", ENDITEM,
"Name=hidRemark", "Value=hidden", ENDITEM,
"Name=remarkFilePath", "Value=", "File=yes", ENDITEM,
"Name=testPresetCondition", "Value=N/A", ENDITEM,
"Name=hidCondition", "Value=hidden", ENDITEM,
"Name=conditionFilePath", "Value=", "File=yes", ENDITEM,
"Name=expectResult", "Value=N/A", ENDITEM,
"Name=hidExpectresult", "Value=hidden", ENDITEM,
"Name=expectResultFilePath", "Value=", "File=yes", ENDITEM,
EXTRARES,
"Url=img/tree_img/mousebg2.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=images/blank.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
LAST);
// Tree refresh
web_url("oneTreeShow_5",
"URL=http://172.19.97.109/utms/common/oneTreeShow?method=itemandcase&itemID=728644&projectID=0&roundID=0",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library",
"Snapshot=t13.inf",
"Mode=HTML",
EXTRARES,
"Url=../images/I.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../images/foldericon.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../img/tree_img/mousebg3.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../img/tree_img/item2-open.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../img/tree_img/mousebg2.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../img/tree_img/mousebg1.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../images/blank.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../img/tree_img/case.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../images/Lplus.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=../images/Tplus.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
LAST);
// Click the case node
web_url("caseDetail.do",
"URL=http://172.19.97.109/utms/caseDetail.do?tag=2&projectID=0&roundID=0&caseID=580297",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.19.97.109/utms/",
"Snapshot=t14.inf",
"Mode=HTML",
EXTRARES,
"Url=images/I.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=img/tree_img/mousebg1.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=images/blank.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=images/Lplus.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=images/Tplus.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=img/tree_img/case.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=img/tree_img/mousebg3.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=images/Tminus.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=images/foldericon.png", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=img/tree_img/mousebg2.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
"Url=img/tree_img/item2-open.gif", "Referer=http://172.19.97.109/utms/fourTree.do?tag=ALL&type=library", ENDITEM,
LAST);
当增加虚拟用户后,应该是每个用户都创建自己的case,操作自己的case,因此58029这个ID应该被参数化,但在这一组语句中,创建完case后并没有办法获取其ID,那我应该如何参数化这个ID呢?应该给其赋什么值呢? |
|