qileilove

          blog已經轉移至github,大家請訪問 http://qaseven.github.io/

          LoadRunner關聯的高級應用

          Action()
          {
          int array_len ,i=1;
          char array_name[20];

            //通過關聯找出所有的省市的連接地址

          web_reg_save_param("outFlightVal",
          "LB=\"http:\/\/a.lietou.com\/",
          "RB=.shtml\">",
          "ORD=ALL",
          LAST);
          web_url("a.lietou.com",
          "URL=http://a.lietou.com",
          "Resource=0",
          "RecContentType=text/html",
          "Referer=",
          "Snapshot=t25.inf",
          "Mode=HTML",
          EXTRARES,
          LAST);

            //計算獲取省市的個數,為下面的循環訪問做準備

          array_len=atoi(lr_eval_string("{outFlightVal_count}"));
          lr_output_message("%d",array_len);
          for (i=1;i<=array_len;i++) {

            //拼接省市請求url

          sprintf(array_name,"{outFlightVal_%d}",i);
          lr_output_message("%s",lr_eval_string(array_name));
          lr_save_string(lr_eval_string(array_name),"shen");

            //關聯獲取title字段內容

          web_reg_save_param("title",
          "LB=<title>",
          "RB=</title>",
          "ORD=1",
          LAST);

            //關聯獲取content字段內容

          web_reg_save_param("content",
          "LB=content=",
          "RB=\/>\r\n",
          "ORD=1",
          LAST);
          web_url("a.lietou.com",
          "URL=http://a.lietou.com/{shen}.shtml",
          "Resource=0",
          "RecContentType=text/html",
          "Referer=",
          "Snapshot=t25.inf",
          "Mode=HTML",
          EXTRARES,
          LAST);
          }
          return 0;
          }

          posted on 2013-08-22 11:06 順其自然EVO 閱讀(244) 評論(0)  編輯  收藏 所屬分類: loadrunner

          <2013年8月>
          28293031123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導航

          統計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 中牟县| 莫力| 通榆县| 五家渠市| 西青区| 吉木萨尔县| 敦化市| 陇南市| 古田县| 甘孜| 齐齐哈尔市| 双牌县| 泊头市| 唐河县| 阿坝县| 青神县| 潮州市| 桂平市| 张家界市| 连州市| 德兴市| 洮南市| 鹿泉市| 福海县| 广东省| 南汇区| 和田县| 当雄县| 永春县| 祁连县| 龙游县| 施甸县| 富裕县| 攀枝花市| 大庆市| 通山县| 澄城县| 辛集市| 北宁市| 南平市| 云霄县|