zoukankan      html  css  js  c++  java
  • 关于怎么在LR中模拟下载的动作

    关于怎么在LR中模拟下载的动作(选自51testing)

    #include "as_web.h"


    Action()
    {
    long i,fp;
     web_add_cookie("sid=26CE7C; DOMAIN=www.51testing.com");

     web_add_cookie("_cookietime=31536000; DOMAIN=www.51testing.com");

     web_add_cookie("_discuz_uid=2327; DOMAIN=www.51testing.com");

     web_add_cookie("_discuz_pw=6cd9c1d7e2498582eddcf7a91a936c06; DOMAIN=www.51testing.com");

     web_add_cookie("_discuz_secques=6ccf9bcd; DOMAIN=www.51testing.com");

     web_add_cookie("oldtopics=%096342%09; DOMAIN=www.51testing.com");

     web_url("www.51testing.com",
      "URL=http://www.51testing.com/",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t4.inf",
      "Mode=HTML",
      LAST);

     web_url("opsdirective.xml",
      "URL=http://toolbar.msn.com/static/msntbs15/opsdirective.xml?type=2",
      "Resource=0",
      "RecContentType=text/xml",
      "Referer=",
      "Snapshot=t5.inf",
      "Mode=HTML",
      LAST);

     web_url("index.htm",
      "URL=http://www.51testing.com/index/index.htm",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t6.inf",
      "Mode=HTML",
      EXTRARES,
      "Url=lib/flash/logo.swf", "Referer=", ENDITEM,
      "Url=lib/flash/title.swf", "Referer=", ENDITEM,
      "Url=../common/lib/liuchengxx1.swf", "Referer=", ENDITEM,
      LAST);

     web_link("51Testing软件测试论坛",
      "Text=51Testing软件测试论坛",
      "Snapshot=t7.inf",
      EXTRARES,
      "Url=images/default/bg.gif", ENDITEM,
      "Url=flash/title.swf", "Referer=", ENDITEM,
      "Url=images/default/headerbg.gif", ENDITEM,
      "Url=images/default/catbg.gif", ENDITEM,
      LAST);

     lr_think_time( 3 );

     web_link("[LoadRunner]",
      "Text=[LoadRunner]",
      "Snapshot=t8.inf",
      EXTRARES,
      "Url=images/default/bg.gif", "Referer=http://www.51testing.com/cgi-bin/forumdisplay.php?fid=67", ENDITEM,
      "Url=flash/title.swf", "Referer=", ENDITEM,
      "Url=images/default/headerbg.gif", "Referer=http://www.51testing.com/cgi-bin/forumdisplay.php?fid=67", ENDITEM,
      LAST);

     lr_think_time( 1 );

     web_link("我编写了一个小脚本,其中讲叙了怎样做关联,怎样写custom request供大家参考",
      "Text=我编写了一个小脚本,其中讲叙了怎样做关联,怎样写custom request供大家参考",
      "Snapshot=t9.inf",
      EXTRARES,
      "Url=images/default/bg.gif", "Referer=http://www.51testing.com/cgi-bin/viewthread.php?tid=13860&fpage=1", ENDITEM,
      "Url=flash/title.swf", "Referer=", ENDITEM,
      "Url=images/default/headerbg.gif", "Referer=http://www.51testing.com/cgi-bin/viewthread.php?tid=13860&fpage=1", ENDITEM,
      LAST);


     lr_start_transaction("DownLoad");
        fp = fopen("c:\\flight.rar","wb");
        web_set_max_html_param_len("500000");
        web_reg_save_param("FILED","LB=","RB=","Search=Body",LAST);
     web_link("flight_script13.rar",
      "Text=flight_script13.rar",
      "Snapshot=t10.inf",
      LAST);
       i = web_get_int_property( HTTP_INFO_DOWNLOAD_SIZE );
       if (i>0)
      {

         fwrite(lr_eval_string("{FILED}"),i,1,fp);
      }
     lr_think_time( 4 );
       fclose(fp);
     lr_end_transaction("DownLoad", LR_AUTO);

     return 0;
    }

  • 相关阅读:
    sql server 镜像操作
    微信测试公众号的创见以及菜单创建
    linux安装redis步骤
    Mysql 查询表字段数量
    linux 链接mysql并覆盖数据
    linux (centos)增删改查用户命令
    CentOS修改用户密码方法
    https原理及其中所包含的对称加密、非对称加密、数字证书、数字签名
    com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. 问题解决方法
    设计模式(三):模板方法模式
  • 原文地址:https://www.cnblogs.com/tester2test/p/412019.html
Copyright © 2011-2022 走看看