TA的每日心情 | 奋斗 2015-8-4 09:44 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
你好。这个问题。用的函数是 web_custom_request,他的格式是
web_custom_request("Publish",
"Url= http://116.211.23.123/SNS/Publish.htm",
"Method=POST",
"Referer=http://116.211.23.123/SNS/Publish.htm ",
"Mode=HTTP",
"body=SNSID=7999&UserID=1"
LAST);
web_custom_request中提交的数据(body)是以这样的方式存在的“Body=属性名称=属性值&属性名称=属性值&……”,
需要注意的地方就是web_custom_request中body中的属性值如果包含一些特殊字符,必须通过URL编码,否则Web服务器会返回500错误,一个典型的例子是如果Body中包含ViewState,ViewState中常常有“=”之类的特殊字符,此时必须通过URL编码,LoadRuner中提供了一个这样的编码转换函数
web_convert_param(“vs1″, “SourceEncoding=HTML”, “TargetEncoding=URL”, LAST);
除LoadRunner外,你可以在Fiddler中按Ctrl+E来转换
解决方法摘自:http://blog.sina.com.cn/s/blog_6a22ab680100pxl2.html |
评分
-
查看全部评分
|