qileilove

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

          LR關于對參數進行截取操作的實踐

          腳本:

          Action()
          {
          char *username;
          lr_output_message("參數值為:%s",lr_eval_string("{NewParam}"));
          username=lr_eval_string("{NewParam}");
          lr_output_message("username的值是:%s",username);
          lr_output_message("截取后的值:%s",strtok(lr_eval_string("{NewParam}"),"kibon"));
          //strtok 返回特殊標記分割的字符
          lr_save_string((char*)strtok(lr_eval_string("{NewParam}"),"kibon"),"temp");
          lr_output_message("變量的值為:%s",lr_eval_string("{temp}"));
          return 0;
          }

            執行結果:

          Starting iteration 1.
          Starting action Action.
          Action.c(5): Notify: Parameter Substitution: parameter "NewParam" =  "kibon001"
          Action.c(5): 參數值為:kibon001
          Action.c(7): Notify: Parameter Substitution: parameter "NewParam" =  "kibon001"
          Action.c(9): username的值是:kibon001
          Action.c(11): Notify: Parameter Substitution: parameter "NewParam" =  "kibon001"
          Action.c(11): 截取后的值:001
          Action.c(14): Notify: Parameter Substitution: parameter "NewParam" =  "kibon001"
          Action.c(14): Notify: Saving Parameter "temp = 001".
          Action.c(16): Notify: Parameter Substitution: parameter "temp" =  "001"
          Action.c(16): 變量的值為:001
          Ending action Action.
          Ending iteration 1.

          posted on 2013-09-27 10:40 順其自然EVO 閱讀(1073) 評論(0)  編輯  收藏 所屬分類: loadrunner

          <2013年9月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          導航

          統計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 潞西市| 石楼县| 临江市| 北海市| 定结县| 平阴县| 密云县| 平潭县| 营山县| 深水埗区| 中西区| 任丘市| 江源县| 陵水| 延寿县| 德清县| 宜阳县| 罗江县| 平和县| 武夷山市| 抚州市| 巴彦淖尔市| 舟山市| 隆林| 大邑县| 衢州市| 类乌齐县| 舒城县| 定安县| 哈尔滨市| 铜川市| 牡丹江市| 贵州省| 郎溪县| 锦屏县| 古浪县| 藁城市| 乌兰察布市| 肇东市| 咸丰县| 常德市|