zoukankan      html  css  js  c++  java
  • loadrunner 中数组的定义

    loadrunner 中数组的定义:

    lr_save_string("www.google.com","website_1");

    lr_save_string("www.baidu.com","website_2");

    lr_save_string("www.163.com","website_3");

    lr_save_string("www.sina.com","website_4");

    lr_save_string("4","website_count");//定义数组长度

    数组的取值:

    char *siteval;

    siteval = lr_paramarr_idx("website",2)

    上述代码得到的值是www.baidu.com

    获取数组的长度

    int arrSize;

    arrSize = lr_paramarr_len("website");

    从数组中随机取值

    char * siteval;

    siteval = lr_paramarr_random("website");

    完整代码示例:

    Action()
    {
    char * siteval;
    int arrsize;

    lr_save_string("www.google.com","website_1");

    lr_save_string("www.163.com","website_2");

    lr_save_string("www.sina.com","website_3");

    lr_save_string("www.baidu.com","website_4");

    lr_save_string("4","website_count");

    siteval=lr_paramarr_idx("website",2);
    lr_message(lr_eval_string(siteval));

    arrsize=lr_paramarr_len("website");
    lr_message("%d",arrsize);

    return 0;
    }

  • 相关阅读:
    Mysql分布式事务
    Mysql锁
    Mysql事务隔离级别
    java 资源监控
    Mysql子查询
    javaWeb四大域对象
    KVM 迁移
    KVM 虚拟化
    网络基础
    系统简单启动过程
  • 原文地址:https://www.cnblogs.com/lu215225/p/2986593.html
Copyright © 2011-2022 走看看