|
现在公司要对项目进行电子书上传的性能测试,搞了好几天了,还是没有解决,按照网上的设置都试过了,回放脚本,还是没有解决。电子老上传不了。
那位有没有做过类似的的性能测试,怎么样解决这样的脚本问题呀。网上查了好久了,相关的资料比较少。
提交脚本如下:
第一种方式录制的脚本如下:
web_submit_data("uploadBookPackage.action",
"Action=http://XXXX/uploadBookPackage.action",
"Method=POST",
"EncType=multipart/form-data",
"TargetFrame=",
"RecContentType=text/html",
"Referer=",
"Snapshot=t29.inf",
"Mode=HTML",
ITEMDATA,
"Name=Filename", "Value=E:\\book\\guangchang\\蜗居.ocf", ENDITEM,
"Name=colid1", "Value=1000001239749", ENDITEM,
"Name=cpName", "Value=%E5%AE%87%E5%A4%A9%E7%A7%91%E6%8A%80", ENDITEM,
"Name=bsName", "Value=%E4%B9%A6%E7%B1%8D", ENDITEM,
"Name=startTime", "Value=2010-07-02 23:59:59", ENDITEM,
"Name=standardcolid1", "Value=1000001231547", ENDITEM,
"Name=stopTime", "Value=2011-07-02 00:00:00", ENDITEM,
"Name=bssortid1", "Value=1000001231523", ENDITEM,
LAST);
第二种方式录制的脚本如下:
之前脚本如果不对录制的方式设置,录制的脚本会多一个文件【lrw_custom_body.h】,保存的都是类似如下的的代码
【const char * const body_variable_1 = "BodyBinary=------------cH2Ij5cH2Ef1ei4Ij5Ij5cH2GI3gL6\r\n"
"Content-Disposition: form-data; name=\"Filename\"\r\n"
"\r\n"
"鍦扮嫳鐨勭19灞俖鎮枒.ocf\r\n"
"------------cH2Ij5cH2Ef1ei4Ij5Ij5cH2GI3gL6\r\n"
"Content-Disposition: form-data; name=\"colid1\"\r\n"
"\r\n"
"1000001300792\r\n"
"------------cH2Ij5cH2Ef1ei4Ij5Ij5cH2GI3gL6\r\n"】
脚本也是如下【
web_custom_request("uploadBookPackage.action",
"URL=http://XXX/uploadBookPackage.action",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t10.inf",
"Mode=HTML",
"EncType=multipart/form-data; boundary=----------cH2Ij5cH2Ef1ei4Ij5Ij5cH2GI3gL6",
body_variable_1,
LAST);】 |
|