zoukankan      html  css  js  c++  java
  • 飞机订票-1注册用户脚本

    一、要求:

    1、可以注册1000个用户

    2、要保证脚本可以持续的运行,不能说运行一次,就不能再运行

    3、做好手动事务判断

    二、思路:

    注册一次用户,用时间参数做用户名的参数化,然后迭代1000次

    三、脚本(看着乱,但粘贴到LR中就好了)

    Action() {

       web_url("WebTours",  

              "URL=http://127.0.0.1:1080/WebTours/",  

              "TargetFrame=",  

              "Resource=0",  

              "RecContentType=text/html",   

              "Referer=",

              "Snapshot=t1.inf",

              "Mode=HTML",   LAST);

     /*Thank you, elsa1, for registering and welcome to the Web Tours family. We hope we can meet all your current and future travel needs. If you have any questions, feel free to ask our support staff. Click below when you're ready to plan your dream trip*/    

           lr_start_transaction("flight_url");  

     web_reg_find("Search=All",   

             "SaveCount=sign_count",  

             "Text=First time registering? Please complete the form below.",   LAST);

     web_url("sign up now",   

             "URL=http://127.0.0.1:1080/WebTours/login.pl?username=&password=&getInfo=true",

             "TargetFrame=body",

             "Resource=0",  

             "RecContentType=text/html",   

             "Referer=http://127.0.0.1:1080/WebTours/home.html",   

             "Snapshot=t2.inf",  

            "Mode=HTML",   LAST);

       lr_output_message("############%s#############",lr_eval_string("{sign_count}"));

     web_reg_find("Search=All",  

            "SaveCount=sign_count1",   

            "Text=Thank you",   LAST);

     web_submit_data("login.pl",  

           "Action=http://127.0.0.1:1080/WebTours/login.pl",  

           "Method=POST",   

           "TargetFrame=info",  

           "RecContentType=text/html",   

           "Referer=http://127.0.0.1:1080/WebTours/login.pl?username=&password=&getInfo=true",

           "Snapshot=t3.inf",   

           "Mode=HTML",  

           ITEMDATA,  

          "Name=username",

          "Value=Li{Param1}", ENDITEM,  

          "Name=password", "Value=12345", ENDITEM,   

          "Name=passwordConfirm", "Value=12345", ENDITEM,   

          "Name=firstName", "Value=12345", ENDITEM,

          "Name=lastName", "Value=12345", ENDITEM,   

          "Name=address1", "Value=12345", ENDITEM,  

          "Name=address2", "Value=12345", ENDITEM,   

          "Name=register.x", "Value=24", ENDITEM,    

          "Name=register.y", "Value=9", ENDITEM,   LAST);  

      lr_output_message("%s",lr_eval_string("{Param1}"));

      lr_output_message("############%s#############",lr_eval_string("{sign_count1}"));  

      if(strcmp(lr_eval_string("{sign_count}"),"1")){  

                lr_output_message("******************************");  

                lr_end_transaction("flight_url",LR_FAIL);   }else{  

                         if(strcmp(lr_eval_string("{sign_count1}"),"1")){

                          lr_output_message("%%%%%%%%%%%%%%%%%%%%%%%%%%");     

                         lr_end_transaction("flight_url",LR_FAIL);       }else{   

                                 lr_output_message("#######################");  

     lr_end_transaction("flight_url",LR_PASS);  }

     }

     return 0;

    }

  • 相关阅读:
    Sublime Text 3 3126 注册码
    修改bootstrap 的全局样式,bootstrap 3.0 是由html5和CSS 3组成的
    mysql-sql高级应用
    MySQL 主键冲突,无法插入数据
    jquery加载页面的方法(页面加载完成就执行)
    Jquery怎么获取select选中项 自定义属性的值
    使用Yii2中dropdownlist实现地区三级联动的例子
    Yii2中省市三级联动(栏目联动)
    [HNOI2009] 梦幻布丁
    [CJOJ2410]数列操作d
  • 原文地址:https://www.cnblogs.com/Miss-Elsa/p/5866839.html
Copyright © 2011-2022 走看看