陈绍英

探索中国软件测试之道

chenshaoyingID:chenshaoying
238308次访问,排名264好友16人,关注者28
chenshaoying的文章
原创 96 篇
翻译 0 篇
转载 52 篇
评论 246 篇
陈绍英的公告
《软件测试与持续质量改进》邮电出版社 2008年1月出版
《LoadRunner性能测试实战》电子出版社 2007年9月出版

《Web性能测试实战》电子出版社 2006年6月出版


最近评论
tanjunlu:很好,的确让人有所感悟。。。
chenshaoying:正在写的新书。
wanggege11:陈老师,请问是哪本书上的案例呢。。我现在手头有《LR性能测试实战》和《WEB性能测试》两本书,上星期才买到《WEB性能测试》,呵呵。
这两个BIN文件,如何用呢~~
wanggege11:陈老师,请问是哪本书上的案例呢。。我现在手头有《LR性能测试实战》和《WEB性能测试》两本书,上星期才买到《WEB性能测试》,呵呵。
这两个BIN文件,如何用呢~~
YANGMAOXING:我是学生,以后想在软件测试方面发展,多谢老师的指导啦!!!!!
文章分类
收藏
    相册
    IT交流
    生活照
    测试同行
    aawolf = new Mobile.MVP
    Sean.Pu的Platform
    TestWin 软件测试之窗(袁琳)
    xingcyx(代码未动,测试先行)
    天行健,君子当自强不息
    朱少民-软件测试和质量专栏
    测试泡泡--偶尔看到的。
    开发朋友
    JAVA世纪网
    田洪川blog
    同学友人
    小布的性能调优客论坛
    崔启亮
    写作朋友
    华章
    博文周老师
    孟岩
    泰稳——编辑空间@《程序员》
    田洪川blog
    良葛格学习笔记
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 如何使用web_reg_save_param方法保存的多个参数? 收藏

    新一篇: Loadrunner中Std性能指标的含义 | 旧一篇: 白领们是怎样被下流化的

    如何使用web_reg_save_param方法保存的多个参数?

    web_reg_save_param方法中,如果参数部分指明"ORD=ALL",则可以保存多个参数。例如“web_reg_save_param("flight_num","LB=<input type=\"checkbox\" name=\"","RB=\" value=\"on\">","ORD=ALL",LAST)”,将会根据实际情况查找符合条件的内容,然后把找到的结果依次保存在参数flight_num_1flight_num_2flight_num_3、……中。如果要使用这些参数,可以借助数组来完成。

    下面的示例演示了在订票程序中,如何把找到的票号保存到数组中,然后利用循环语句生成参数名称并保存到数组中。得到参数列表后,接下来就能进行其它操作,例如删除订票等。

    Action()

    {  int i;

       int  count;

       char param[10][20];

       web_reg_save_param("flight_num","LB=<input type=\"checkbox\" name=\"","RB=\" value=\"on\">","ORD=ALL",LAST);

           web_url("com.mercurytours.servlet.IteneraryServlet",

                  "URL=http://localhost/servlets/com.mercurytours.servlet.IteneraryServlet",

                  "TargetFrame=",

                  "Resource=0",

                  "RecContentType=text/html",

                  "Referer=http://localhost/servlets/com.mercurytours.servlet.ReservationServlet",

                  "Snapshot=t3.inf",

                  "Mode=HTML",

                  LAST);

        count=atoi(lr_eval_string("{flight_num_count}"));

        lr_error_message("已经订票的数量:%d",count);

         for(i=1;i<=count;i++){

           sprintf(param[i],"{flight_num_%d}",i);//参数名称存到数组中

           lr_error_message(param[i]);

          }

         for(i=1;i<=count;i++){     

           lr_error_message(lr_eval_string(param[i]));//使用参数

          }

           return 0;

    }

     

    发表于 @ 2007年08月02日 10:38:00|评论(loading...)|编辑

    新一篇: Loadrunner中Std性能指标的含义 | 旧一篇: 白领们是怎样被下流化的

    评论

    #interest 发表于2007-09-03 15:26:39  IP: 211.157.5.*
    我有1个问题请教您一下:
    lr_eval_string("{flight_num_count}")为什么返回的是参数个数??

    我自己写脚本验证了一下,发现确实是返回参数的个数,但是为什么呢?

    我查了LR帮助里函数手册,没找到相关的说明
    #chenshaoying 发表于2007-09-03 16:58:06  IP: 211.167.69.*
    Vugen的函数帮助里面有详细说明:

    The web_reg_save_param function also supports array type parameters. When you specify ORD=All, all the occurrences of the match are saved in an array. Each element of the array is represented by the ParamName_index. In the following example, the parameter name is A:

    web_reg_save_param("A", "LB/ic=<a href=", "RB=\'>", "Ord=All", LAST);


    The first match is saved as A_1, the second match is saved as A_2, and so forth. You can retrieve the total number of matches by using the following term: ParamName_count. For example, to retrieve the total number of matches saved to the parameter array, use:

    TotalNumberOfMatches=atoi(lr_eval_string("{A_count}"));

    #interest 发表于2007-09-04 08:54:50  IP: 211.157.5.*
    哈,thanks~~
    我没看web_reg_save_param()的帮助,只去查了atoi()和 lr_eval_string()的,不仔细啊不仔细~~
    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 陈绍英