51Testing软件测试论坛

标题: LOadRunner中发送post消息,遇到困难求助! [打印本页]

作者: ysh0033    时间: 2010-10-28 14:43
标题: LOadRunner中发送post消息,遇到困难求助!
POST /requesttransaction HTTP/1.1
Accept: image/gif,image/x-xbitmap
Host: 10.71.113.170:8080
Content-Length:129
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Accept-Encoding: gzip,deflate

TransType=5&UserType=1&SrcMdn=13699999999&ContID=0100100900&ContTitle=wzh0330&SubMsg=&DevMdns=13612222123&TimeOut=-1&BeginTime=-1


知道用 web_custon_request函数,但具体格式不太明白了。
望高手帮忙解答 谢谢!
作者: skyzhu    时间: 2010-10-28 15:07
web_submit_data("requesttransaction",
                "Action=http://test.test.com/requesttransaction",
                "Method=POST",
                "RecContentType=text/html",
                "Mode=HTTP",
                ITEMDATA,
                "Name=TransType", "Value=5", ENDITEM,
                "Name=UserType", "Value=1", ENDITEM,
                "Name=SrcMdn", "Value=13699999999", ENDITEM,
                  剩下自己写
                LAST);


另外个

web_add_header("Content-Type", "application/x-www-form-urlencoded");

web_custom_request("requesttransaction ", "Method=POST",
       "URL=http://test.test.com/requesttransaction ",
       "Body=TransType=5&UserType=1&SrcMdn=13699999999&ContID=0100100900&ContTitle=wzh0330&SubMsg=&DevMdns=13612222123&TimeOut=-1&BeginTime=-1",
       LAST);
作者: PrefTest    时间: 2010-10-28 16:15
LoadRunner帮助文档中有详细的函数格式和使用方法,还有例子,摘录如下:
web_add_header("Content–Type",

"multipart/form–data; boundary=–––––––––––––––––––––––––––292742461228954");

web_custom_request("post_query.exe", "Method=POST",

    "URL=http://lazarus/cgi–bin/post_query.exe",

    "Body=–––––––––––––––––––––––––––––292742461228954\r\nContent–Disp"

    "osition: form–data; name=\"entry\"\r\n\r\nText\r\n––––––––––"

    "–––––––––––––––––––292742461228954\r\nContent–Disposition: f"

    "–––––––––––292742461228954––\r\n",

    "TargetFrame=",

    LAST );

配合HttpWatch等截包工具使用效果尤佳!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2