zoukankan      html  css  js  c++  java
  • lr_f翻页随机数

    Action()
    {
    int pageSum; //存总共的页数
    char randpage[4];//存随机后的页数

    //访问首页的事务
    lr_start_transaction("homePage");

    web_url("e6mall",
    "URL=http://192.168.1.101:40001/e6mall/",
    LAST);
    lr_end_transaction("homePage",LR_AUTO);

    //取得总共的页数
    web_reg_save_param("page",
    "LB=href="?c=browse&keyword=&cg=&marker=B&page=",
    "RB=">鏈€鍚庨〉</a></span> ",
    LAST);

    web_url("e6mall",
    "URL=http://192.168.1.101:40001/e6mall/?c=browse",
    LAST);

    //取到总分页数,在此范围内随机取值

    pageSum=atoi(lr_eval_string("{page}"));
    //lr_output_message("%d",pageSum);
    //lr_output_message("randpage %d",rand()%pageSum+1);
    itoa(rand()%pageSum+1,randpage,10);
    lr_save_string(randpage,"rpage");

    lr_start_transaction("page");

    web_url("e6mall",
    "URL=http://192.168.1.101:40001/e6mall/?c=browse&keyword=&cg=&marker=B&page={rpage}",
    LAST);

    lr_end_transaction("page",LR_AUTO);
    return 0;
    }

  • 相关阅读:
    C#
    C#
    C#
    C#
    C#
    C#
    系统工具
    远程登录
    文件传输服务
    软件安装
  • 原文地址:https://www.cnblogs.com/stay-sober/p/4322947.html
Copyright © 2011-2022 走看看