zoukankan      html  css  js  c++  java
  • web_reg_save_param 和关联的使用(原创)

    1. 作用:保存动态数据。该数据的来源为html源码。
    2.使用
    顺序:web_reg_save_param();
              web_submit_data();
              lr_message();
     自己在研究的时候,绕了个弯子,将这个顺序颠倒了。幸好在《中国软件测试论坛》中的xieannie网友帮助下搞明白了。在此,谢谢他的帮助!
    3.web_reg_save_param()的 属性
    1)在寻找动态数据时,可以对该数据的范围进行限制,通过左边界和右边界进行限制。即:LB,RB两个属性。

    Portion of string to save to parameter
    LB
    RB
    entire string
    empty
    empty
    a string delimited by boundaries
    boundary
    boundary
    the beginning of a string until the first right boundary
    empty
    boundary
    the last left boundary until the end
    boundary
    empty

    来源loadrunner帮助文档
    其中LB/IC 是忽略字符的大小写。

    2)ORD属性
    是将找到的动态变量保存到数组中。默认是ord=1.如果搜索到的字符是多个,并想将他保存在数组里,则ord=all;他们分别保存到pr_1 pr_2 .....。其中pr_count为内部函数,统计数组的个数。

    3)search 属性
    设置搜索的范围,可以是header,body,header and body,html body。

    4)SaveOffset属性
    偏移量。从搜索到的字符串中,取子串。默认saveoffset=0.
    5) SaveLen 属性
    取串的长度。也是从搜索到的字符串中,取子串。


    4.例子:
    1)
    char *pr

    web_reg_save_param("pr","LB=pr","RB="<br>",LAST);
    web_submit_data("pr.php
                              "url=http://"
                               "TargerFrame=" 
                                ......
                                LAST);
    lr_message("value: %s",lr_eval_string("{pr}"));

    然后你就可以在运行的log中看到结果。
    2)关联的例子

    char *pr

    web_reg_save_param("pr","LB=pr","RB="<br>",LAST);
    web_submit_data("pr.php
                              "url=http://"
                               "TargerFrame=" 
                                ......
                                LAST);

    i=atoi(pr_count)

    这个函数的作用还是蛮大的。希望能得到大家的关注。


  • 相关阅读:
    数学趣题——数字的全排列
    数学趣题——谁在说谎
    数学趣题——移数字游戏
    数学趣题——魔幻方阵
    数学趣题——亲密数
    数学趣题——数字翻译器
    数学趣题——求圆周率的近似值
    数学趣题——完全数
    Linux:CentOS 7 连接ssh方法
    Linux:CentOS 7 服务器之间ssh无密码登录、传输文件
  • 原文地址:https://www.cnblogs.com/morebetter/p/136653.html
Copyright © 2011-2022 走看看