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;

    }

  • 相关阅读:
    操作系统:进程同步
    操作系统:线程的概念
    操作系统:进程的概念与控制
    操作系统:操作系统概述
    CTF-WEB:攻防世界 ics-05(preg_replace() 函数 /e 漏洞)
    《剑指 Offer》学习记录:题 11:旋转数组的最小数字
    《剑指 Offer》学习记录:题 28:对称二叉树
    Linux为什么不是硬实时
    普通线程和内核线程
    linux内核栈和用户栈
  • 原文地址:https://www.cnblogs.com/Miss-Elsa/p/5866839.html
Copyright © 2011-2022 走看看