smh_dss 发表于 2009-10-20 18:46:20

Robot VU脚本参数化

大家好,我初次使用Robot,录制了一个程序,能回放。
我想参数化,对datapool一点都不知道怎么用,只是在Robot中的tools中勾选了datapool选项,不知道怎么产生大量数据,
请大家给我指点指点,非常非常谢谢。

以下是录制的程序:
#include <VU.h>
{
push Http_control = HTTP_PARTIAL_OK | HTTP_CACHE_OK | HTTP_REDIRECT_OK;
push Timeout_scale = 200; /* Set timeouts to 200% of maximum response time */
push Think_def = "LR";
Min_tmout = 120000;       /* Set minimum Timeout_val to 2 minutes          */
push Timeout_val = Min_tmout;

DP1 = datapool_open("1019");
datapool_fetch(DP1);
            
push Think_avg = 0;

D10_56_0_135 = http_request ["1019001"] "10.56.0.135:6443",
   (HTTP_CONN_DIRECT | HTTP_CONN_SECURE),
      "POST /FSMC20/reg/fsmc.reg?validtime="
   + http_url_encode(datapool_value(DP1, "validtime"))+
   "&id="
   + http_url_encode(datapool_value(DP1, "id"))+
   "&pkcs10req=%2D%2D%2D%2D%2DBEGIN+NEW+CERTIFICATE+"
   "REQUEST%2D%2D%2D%2D%2D%0D%0AMIID1jCCAz8CAQAwHzEdMBsGA1UEAx4UAFMATQBDAF8AQ"
   "wBsAGkAZQBuAHQwgZ8w%0D%0ADQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKPpY7n7raWfS7lM"
   "s8Bv%2BtoKT8A4bQt2%0D%0AZwlmlzZm3nonzXLKhDa8dcikO%2BeQG8QyXXpca0JQsaOT9jV"
   "yNUMZJvzuv%2BZly4jw%0D%0Afx3QoMbCDmyNmIi8iURTW8c9qa9%2By2OHpmFraibr4SXNLM"
   "nJ27pOCcSY2UfRj0Em%0D%0AQvLhxc1gt0QTAgMBAAGgggJ1MBoGCisGAQQBgjcNAgMxDBYKN"
   "S4xLjI2MDAuMjA6%0D%0ABgkrBgEEAYI3FRQxLTArAgEBDAh0ZXN0MDIyNwwNVEVTVDAyMjdc"
   "dGVzdAwNRkFH%0D%0ARU5UQVBQLkVYRTC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vdrCz2neHcifHy%2BArV7eWGL3t3FRpqL4%2B8%3D%0D%0A%2D%2D%2D%2D%2DEND+"
   "NEW+CERTIFICATE+REQUEST%2D%2D%2D%2D%2D%0D%0A&computername="
   + http_url_encode(datapool_value(DP1, "computername"))+
   "&domainname="
   + http_url_encode(datapool_value(DP1, "domainname"))+
   " HTTP/1.0\r\n"
   "User-Agent: My Firm\r\n"
   "Host: 10.56.0.135\r\n"
   "Connection: Keep-Alive\r\n"
   "\r\n";

set Server_connection = D10_56_0_135;

http_header_recv ["1019002"]200;      /* GENERATED */

http_nrecv ["1019003"]100 %% ;      /*unknown length*/

http_disconnect(D10_56_0_135);

pop ;

pop Http_control;

}

DATAPOOL_CONFIG "1019"OVERRIDE DP_NOWRAP DP_SEQUENTIAL DP_SHARED
{
      EXCLUDE, "computername", "string", "TEST0227";
      EXCLUDE, "domainname", "string", "WORKGROUP";
      EXCLUDE, "id", "string", "SECUDE_FSMC_Version_2.0";
      EXCLUDE, "validtime", "string", "1256116453993";
}

smh_dss 发表于 2009-10-22 16:14:33

参数化问题解决了,谢谢

在精华区搜索了一些datapool的帖子,创建一个datapool后,手工输入了一些数据,然后在代码中加入了循环,运行成功了
页: [1]
查看完整版本: Robot VU脚本参数化