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"

  • 相关阅读:
    element-ui 中dialog居中
    点击element-ui表格中的图标,上方显示具体的文字描述
    第一节:模板模式——需求说明&基本介绍
    第六节:代理模式——总结
    第五节:代理模式——代理模式的变体
    第四节:代理模式——cglib代理
    第三节:代理模式——动态代理
    第二节:代理模式——静态代理
    第一节:代理模式——基本介绍
    第四节:享元模式——总结
  • 原文地址:https://www.cnblogs.com/morebetter/p/210785.html
Copyright © 2011-2022 走看看