我在loadrunner中用js编写了一些脚本。昨天我需要一个函数“ web_submit_data”。在C上,其语法如下:
    int web_submit_data(const char *StepName, const char *Action, <List of Attributes>, ITEMDATA, <List of data>, [EXTRARES, <List of Resource Attributes>,] LAST);
要设置“数据列表”,我需要ENDITEM常量,但是在JS Vuser中找不到它。
我尝试了ENDITEM,web.ENDITEM,“ ENDITEM”,但所有方法均无效。
因此,现在我对该函数的调用如下所示:

web.submit_data("bsi.dll_14",
  "Action=http://someaddr.org/a/b/c",
  new Array(
    "Method=POST",
    "EncType=multipart/form-data",
    "TargetFrame=",
    "RecContentType=text\html"
    "Referer=http://some.ref.link.org/"
    "Snapshot=t70.inf",
    "Mode=HTML"),
  new Array(
    new String("Name=exName1"), new String("Value=val1"),
    new String("Name=exName2"), new String("Value=val2")));


我对此没有任何错误,但是发送的HTTP包不包含我尝试发送的数据。那么,有人可以帮助我实现这一疯狂功能吗?我应该如何在Javascript vuser中使用web.submit_data?
提前致谢。



附言对不起,我的英语不好。我试图写可以理解的东西。

最佳答案

从文档中:

Web Vuser Functions (WEB)
Web Vusers perform tests that communicate with the servers using the HTTP protocol. The                 Web protocol is generally used to test Internet sites.

The default language for the Web protocol is C. Recording sessions create tests in C.

Java and Visual Basic syntax are supported for a sub-set of the Web functions. C++ can      be used when writing tests with external programming tools.

Web Vuser scripts are supported in three syntaxes:

Web Vuser Functions: C Language (WEB)

Web Vuser Functions: Java Language (web.)

Web Vuser Functions: VB (web.)


所以我想不支持JS。

10-07 17:01