qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請訪問 http://qaseven.github.io/

          LoadRunner關(guān)聯(lián)的高級應(yīng)用

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

            //通過關(guān)聯(lián)找出所有的省市的連接地址

          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);

            //計算獲取省市的個數(shù),為下面的循環(huán)訪問做準(zhǔn)備

          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");

            //關(guān)聯(lián)獲取title字段內(nèi)容

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

            //關(guān)聯(lián)獲取content字段內(nèi)容

          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 閱讀(242) 評論(0)  編輯  收藏 所屬分類: loadrunner

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

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 贡嘎县| 朝阳市| 鹰潭市| 巴马| 银川市| 宝兴县| 汪清县| 临夏县| 广东省| 凉城县| 宜春市| 青州市| 绥江县| 双江| 巴林右旗| 金溪县| 诸暨市| 上饶市| 平乡县| 石林| 融水| 宜昌市| 临颍县| 松阳县| 波密县| 秭归县| 商城县| 鄂托克前旗| 泰州市| 博乐市| 承德县| 商丘市| 民和| 桓台县| 蒲城县| 柳林县| 丰镇市| 确山县| 遂溪县| 扬州市| 佳木斯市|