zoukankan      html  css  js  c++  java
  • lr--atoi、itoa

    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); //在pageSum范围取随机,使用itoa以10进制方式转换成string保存到randpage中
    lr_save_string(randpage,"rpage");//把string格式的分页数,保存到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;
    }

  • 相关阅读:
    Java 日志
    编写用例文档
    uml用例关系
    地址线和数据线
    Android总结
    DbUtil数据库连接
    PropertiesUtil
    log4j.properties配置
    自定义博客样式
    css给文字加下划线
  • 原文地址:https://www.cnblogs.com/stay-sober/p/4308743.html
Copyright © 2011-2022 走看看