zoukankan      html  css  js  c++  java
  • lr中web_reg_find函数

    一、函数的作用
    搜索web页面中html的代码
    二、函数的属性
    1.text:要搜索的字符串。如text="search"
    2.textpfx:搜索词的左边界
    3.textsfx:搜索词的右边界
    4.search:搜索的范围,只搜索头文件,或搜索body。默认是搜索全部。
    5.savecount:记录搜索到的字符的个数
    6.fail:指明fail的条件。如fail=found,则找到为失败
    7.found
    8.id:
    三、例子

    Example 1

    In the following example, web_reg_find function searches for the text string "Welcome". If the string is not found, it fails and the script execution stops.

    web_reg_find("Text=Welcome", LAST);

    web_url("Step", "URL=...", LAST);

    Example 2

    In the following example, web_reg_find function searches for the text string "Error". If the string is found, it fails and the script execution stops.

    web_reg_find("Text/IC=Error", "Fail=Found", LAST);

    web_url("Step", "URL=...", LAST);

    Example 3

    In the following example, web_reg_find function searches for the text string "ABC". If the string is not found, the script executes Action A. If the string is found one or more times, it executes Action B.

    web_reg_find("Text=ABC", "SaveCount=abc_count", LAST);

    web_url("Step", "URL=...", LAST);

    if (strcmp(lr_eval_string("{abc_count}"), "0") == 0)

    Action A

    else

    Action B

    Example 4

    In the following example, an ID argument "XYZ" associates the call to web_reg_find with a line in the log file. If you have to look for the entry in the log file that logged the call to web_reg_find, searching for the string "XYZ" will make it much easier.

    web_reg_find("Text=mitcham", ID=XYZ", LAST);
    web_url("web_url", "URL=http://lazarus/", "TargetFrame=",
              "Resource=0", "Referer=", LAST);

    The entries in the log file will be one of the following, depending on whether the web_reg_find succeeded in finding the text "mitcham" was found:

    Action1.c(12): Matched web_reg_find with "Fail=NotFound" ("XYZ"). Text "mitcham" (count=78)

    Action1.c(10): Error: No match for web_reg_find with "Fail=NotFound" ("XYZ"). Text "mitcham"

  • 相关阅读:
    jQuery选择器
    安装ASP.NET4.0
    自动换行的布局
    一个封装不错的 TcpClient 类
    goland 中国 caisy qq Czx123456
    由于google被墙, 一些go语言包不能下载, 可以通过Chome浏览器到这个网址下载
    在Windows 操作系统中, MySql 如何设置, 允许表名支持大小写
    websocket 的客户端 websocket-sharp
    将一个C++的AES加密算法(有向量的)翻译成C#
    AES 加密问题
  • 原文地址:https://www.cnblogs.com/morebetter/p/210785.html
Copyright © 2011-2022 走看看