51Testing软件测试论坛
标题:
web_submit_data数据参数化问题
[打印本页]
作者:
lightcabbage
时间:
2011-6-22 13:42
标题:
web_submit_data数据参数化问题
上传一个excel文件,包含一些ID值,服务器经过校验,数据库确实存在的标识再进行下发到其他系统,
录制时,向服务器发送下发请求:
web_submit_data("releaseOrganStaffChnlType.action",
"Action=....(省略)",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/html",
"Referer=....(省略)",
"Snapshot=t25.inf",
"Mode=HTML",
ITEMDATA,
"Name=targetType", "Value=ORG", ENDITEM,
"Name=txt", "Value=", ENDITEM,
"Name=batchFile", "Value=", "File=Yes", ENDITEM,
"Name=staffIds", "Value=769062420", ENDITEM,
"Name=staffIds", "Value=769038440", ENDITEM,
"Name=staffIds", "Value=769038441", ENDITEM,
"Name=staffIds", "Value=100003308", ENDITEM,
"Name=staffIds", "Value=100004516", ENDITEM,
"Name=staffIds", "Value=100005440", ENDITEM,
LAST);
已成功关联服务器回复的经过校验的这些ID,上传的EXCEL已进行参数化,每个文件包含的ID数不固定,也就是服务器返回的校验过的ID数目不确定,
"Name=staffIds", "Value=769062420", ENDITEM,
"Name=staffIds", "Value=769038440", ENDITEM,
"Name=staffIds", "Value=769038441", ENDITEM,
"Name=staffIds", "Value=100003308", ENDITEM,
"Name=staffIds", "Value=100004516", ENDITEM,
"Name=staffIds", "Value=100005440", ENDITEM,
这一段怎么进行参数化?
在网上查了资料说手动将web_submit_data这个函数写成等同的web_custom_request,将里头的body进行参数化就可以,但是抓到的上传的body是
-----------------------------7db23249056c
Content-Disposition: form-data; name="targetType"
ORG
-----------------------------7db23249056c
Content-Disposition: form-data; name="txt"
-----------------------------7db23249056c
Content-Disposition: form-data; name="batchFile"; filename=""
Content-Type: application/octet-stream
-----------------------------7db23249056c
Content-Disposition: form-data; name="staffIds"
769038440
-----------------------------7db23249056c
Content-Disposition: form-data; name="staffIds"
769038441
-----------------------------7db23249056c
Content-Disposition: form-data; name="staffIds"
100003308
-----------------------------7db23249056c
Content-Disposition: form-data; name="staffIds"
100004516
-----------------------------7db23249056c--
这个感觉少了第一个和最后一个数据,这个怎么进行参数化?
作者:
lightcabbage
时间:
2011-6-22 13:56
高手在哪里呀
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2