51Testing软件测试论坛

标题: 怎样用LoadRunner模拟如下请求? [打印本页]

作者: higkoo    时间: 2009-2-26 12:44
标题: 怎样用LoadRunner模拟如下请求?
期望模拟的请求:
  1. POST /yourURL/ HTTP/1.1
  2. Content-Type: text/xml
  3. Content-Length: 443
  4. Cache-Control: no-cache
  5. Pragma: no-cache
  6. Accept: text/html
  7. Connection: keep-alive

  8. <?xml version="1.0" encoding="UTF-8"?><content>something</content>
复制代码


尝试:使用web_submit_data,参数非要指定Name和Value。想仅Post一个XmlString过去而已:
  1.         web_submit_data("PostXmlRpc",
  2.                 "Action=http://testServier/yourURL/",
  3.                 "Method=POST",
  4.                 "EncType=multipart/form-data",
  5.         "RecContentType=text/xml",
  6.                 ITEMDATA,
  7.                 "Name=<?xml version",
  8. "Value=\"1.0\" encoding=\"UTF-8\"?><content>something</content>",
  9.                 ENDITEM,
  10.                 LAST);
复制代码

但结果是:
(RelFrameId=1, Internal ID=1)
     -----------------------------7d025e2b16b064e\r\n
     Content-Disposition: form-data; name="<?xml version"\r\n
     \r\n
     "1.0" encoding="UTF-8"?><methodCall xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/exten
     sions"><methodName>auth.getFrob</methodName><params><param><value><struct><member><name>gu
     id</name><value>e6cae838171c4088945e89766751bdcd</value></member><member><name>c</name><va
     lue>4B0D097E</value></member><member><name>appkey</name><value>53C927D1A198A7119AA0F337748
     4FE81</value></member></struct></value></param></params></methodCall>\r\n
     -----------------------------7d025e2b16b064e--\r\n

红色是web_submit_data自动生成而不需要的部分。
作者: higkoo    时间: 2009-2-26 12:54
标题: 晕,问题已解决
用 web_custom_request




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