|
web_submit_dataes("FCSTAdj.aspx_4",
"Action=http://qatest/dfs/FCSTMaintain/FCSTAdj.aspx?moduleid=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&id=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&pid=0",
"Method=POST",
"RecContentType=text/html",
"Referer=http://qatest/dfs/FCSTMaintain/FCSTAdj.aspx?moduleid=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&id=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&pid=0",
"Snapshot=t16.inf",
"Mode=HTTP",
ITEMDATA,
"Name=__EVENTTARGET", "Value=", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={StrViewState_4}", ENDITEM,
"Name=cboProdLine", "Value={ICPline}", ENDITEM,
"Name=hidProdLine", "Value={ICPline}", ENDITEM,
"Name=cboCust", "Value=", ENDITEM,
"Name=hidCust", "Value=", ENDITEM,
"Name=radlOpType", "Value=Modify", ENDITEM,
"Name=hidAType", "Value=0", ENDITEM,
"Name=qbtnSave", "Value=Save", ENDITEM,
//以下是查询时动态产生的控件
"Name=bogrdFCST_BR_1_RC_1_1", "Value=0", ENDITEM,
"Name=bogrdFCST_BR_1_RC_1_2", "Value=0", ENDITEM,
......
"Name=bogrdFCST_BR_9_RC_2_19", "Value=28", ENDITEM,
"Name=hidCurMweek", "Value=200542", ENDITEM,
LAST);
以上脚本执行成功,得到的ViewState是正确的。
但因为动态控件改变时该脚本就不能成功运行,所以我使用关联得到了动态控件的Name和Value。
然后将需要的语句拼接成字符串:OutGridParamTotal。
OutGridParamTotal=" body=__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=dDw3ODI47dDxwPHA8bDmSojrF...
&cboProdLine=STORAGE&hidProdLine=STORAGE&cboCust=&hidCust=&radlOpType=Modify&hidAType=0&qbtnSave=Save
&bogrdFCST_BR_1_RC_1_1=0&bogrdFCST_BR_1_RC_1_2=0&...&bogrdFCST_BR_9_RC_2_19=28&hidCurMweek=200542"
将上述脚本改成:
web_custom_request("FCSTAdj.aspx_4",
"URL=http://qatest/dfs/FCSTMaintain/FCSTAdj.aspx?moduleid=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&id=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&pid=0",
"Method=POST",
"RecContentType=text/html",
"Referer=http://qatest/dfs/FCSTMaintain/FCSTAdj.aspx?moduleid=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&id=145191a2-87b7-4d0e-9bf7-a2c15a1f9701&pid=0",
"Snapshot=t16.inf",
"Mode=HTTP",
OutGridParamTotal,
LAST);
执行结果显示VIEWSTATE有误。
因为我刚刚接触Loadrunner,所以不知道是我使用web_custom_request不正确,还是拼接的字符串OutGridParamTotal有问题。
请各位高手帮忙看一下,谢谢。 |
|