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"

  • 相关阅读:
    Android 上传图片到服务器 okhttp一
    Kotlin 扩展——省略findViewById
    音频的播放一
    layui+ztree 树状下拉框
    Element里el-badge在el-tab里视图不被渲染问题
    linux之cat 操作
    cmd命令行中查看、修改、删除与添加环境变量
    cmd 文件/文件夹的一切操作
    操作
    11. 判断是给属性前加typeof 可以同时判断属性是否存在
  • 原文地址:https://www.cnblogs.com/morebetter/p/210785.html
Copyright © 2011-2022 走看看