51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3286|回复: 1
打印 上一主题 下一主题

[Robot] Robot VU脚本参数化

[复制链接]
  • TA的每日心情
    奋斗
    2016-12-14 13:59
  • 签到天数: 113 天

    连续签到: 1 天

    [LV.6]测试旅长

    跳转到指定楼层
    1#
    发表于 2009-10-20 18:46:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    大家好,我初次使用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%0ARU5UQVBQLkVYRTCB%2FwYKKwYBBAGCNw0CAjGB8DCB7QIBAR5cAE0Aa"
         "QBjAHIAbwBz%0D%0AAG8AZgB0ACAARQBuAGgAYQBuAGMAZQBkACAAQwByAHkAcAB0AG8AZwBy"
         "AGEAcABo%0D%0AAGkAYwAgAFAAcgBvAHYAaQBkAGUAcgAgAHYAMQAuADADgYkAbII1TrHis4a"
         "fw%2Bwb%0D%0ALrZIOYe1boagX3QNyHNj4kpktRyBgIFt6WofQ1nXK6TXmpAm2%2FAmY20%2F"
         "h%2Ba1GZ1%2F%0D%0Avn7EEzHcNQfjvHoSZH7yU5FzvBVs5PGGZ%2F%2FdlrlYX0iY8qhQicT"
         "dPQT3MRoYjUKB%0D%0Avi7IRJnfbWbpQKIZSweblEKN1IYAAAAAAAAAADCCARcGCSqGSIb3DQ"
         "EJDjGCAQgw%0D%0AggEEMA4GA1UdDwEB%2FwQEAwIE8DBEBgkqhkiG9w0BCQ8ENzA1MA4GCCq"
         "GSIb3DQMC%0D%0AAgIAgDAOBggqhkiG9w0DBAICAIAwBwYFKw4DAgcwCgYIKoZIhvcNAwcwHQ"
         "YDVR0O%0D%0ABBYEFCma2V1mJK%2FWP7kft1L%2Bj2hNA1ApMBUGA1UdJQQOMAwGCisGAQQBg"
         "jcKAwQw%0D%0AKwYJKwYBBAGCNxQCBB4eHABzAGUAYwB1AGQAZQAgAGIAZQBpAGoAaQBuAGcw"
         "SQYD%0D%0AVR0RBEIwQIEWYmFvY2hlbi5zaGlAc2VjdWRlLmNvbaAmBgorBgEEAYI3FAIDoBg"
         "M%0D%0AFmJhb2NoZW4uc2hpQHNlY3VkZS5jb20wDQYJKoZIhvcNAQEFBQADgYEAip7K27Rq%0"
         "D%0AoECX%2Fv4QA4i829BHes0IMoRBbFKXevp3cs3WjqLTXA1gt6Ul2PVblhvwMtIkwtCl%0D"
         "%0AUbiv5NDQIjt84hvEoXV6ihujIGJ5WWiLG1%2FaR7y25q377zVhsQ4i3%2FNBT8ROFmsa%0"
         "D%0A7vdrCz2neHcifHy%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 [Think_def, Think_avg, Timeout_val, Timeout_scale];

    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";
    }
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2016-12-14 13:59
  • 签到天数: 113 天

    连续签到: 1 天

    [LV.6]测试旅长

    2#
     楼主| 发表于 2009-10-22 16:14:33 | 只看该作者

    参数化问题解决了,谢谢

    在精华区搜索了一些datapool的帖子,创建一个datapool后,手工输入了一些数据,然后在代码中加入了循环,运行成功了
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-24 19:32 , Processed in 0.075175 second(s), 28 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表