• 常用函数


    常用函数

    Java Vuser  协议脚本

    Web-HTML/HTTP协议脚本

    引用类
    或库文件

    import lrapi.lr;
    import lrapi.web;

    通过globals.h文件引用

    think_time

    lr.think_time(3);

    lr_think_time(3);

    transaction

    lr.start_transaction("事务");
    ......
    lr.end_transaction("事务", lr.AUTO);

    lr_start_transaction("事务");
    ......
    lr_end_transaction("事务", LR_AUTO);

    set_option

    web.set_option("MaxRedirectionDepth", "0",
    new String[]{"LAST"});

    web_set_option("MaxRedirectionDepth", "0",
    LAST );

    set_user

    web.set_user("cluster",
    //lr.decrypt("58cf7265b1677820107f74"),
            "cluster",
            "172.17.2.89:8081");

    web_set_user("cluster",
            //lr_decrypt("58cf7265b1677820107f74"),
            "cluster",
            "172.17.2.89:8081");

    add_header

    web.add_header("Authorization",
    lr.eval_string("<BasicAuth>"));

    web_add_header("Authorization",
    lr_eval_string("{BasicAuth}"));

    output
    message

    lr.save_string("test","tParam");
    lr.output_message("tParam的值为:"
          +lr.eval_string("<tParam>"));

    lr_save_string("test","tParam");
    lr_output_message("tParam的值为:%s",
          lr_eval_string("{tParam}"));

    web_url

    web.url("Show status",
        "URL=http://172.17.2.89:8081/kettle/status/",
        new String[]{
            "Resource=0",
            "RecContentType=text/html",
            "Referer=http://172.17.2.89:8081/",
            "Snapshot=t3.inf",
            "Mode=HTTP",
            "LAST"});

    web_url("Show status",
        "URL=http://172.17.2.89:8081/kettle/status/",
        "Resource=0",
        "RecContentType=text/html",
        "Referer=http://172.17.2.89:8081/",
        "Snapshot=t3.inf",
        "Mode=HTTP",
        LAST);

    web_
    submit_data

    web.submit_data("executeJob",
        "Action=http://172.17.2.89:8081/kettle/executeJob/",
        new String[]{
            "Method=POST",
            "RecContentType=text/html",
            "Referer=",
            "Mode=HTTP"},
        new String[]{// "ITEMDATA",  不要加这条
            "Name=job", "Value=/DZ/job/HYHZ", "ENDITEM",
            "Name=level", "Value=Debug", "ENDITEM",
            "Name=rep", "Value=DZHY0620", "ENDITEM",
            "LAST"});

    web_submit_data("executeJob",
        "Action=http://172.17.2.89:8081/kettle/executeJob/",
        "Method=POST",
        "RecContentType=text/html",
        "Referer=",
        "Mode=HTTP",
        ITEMDATA,
            "Name=job", "Value=/DZ/job/HYHZ", ENDITEM,
            "Name=level", "Value=Debug", ENDITEM,
            "Name=rep", "Value=DZHY0620", ENDITEM,
        LAST);

    web_
    custom_request

    String htmlBody="这里是body串";
    web.custom_request("ViewStreamLogin",
        "Method=POST",
        new String[]{
            "URL=http:/*.*.cn/login?user=test&passwd=123",
            htmlBody,
            "TargetFrame=",
            "Referer=",
            "Mode=HTTP",
            "LAST"});

    web_custom_request("ViewStreamLogin",
        "URL=http:/*.*.cn/login?user=test&passwd=123",
        "Method=POST",
        "TargetFrame=",
        "Resource=0",
        "Referer=",
        "Mode=HTTP",
        "Body=这里是body串",
        LAST);

    web_
    submit_form

    web.submit_form("authenticate",
        new String[]{
            "Snapshot=t2.inf"},
        new String[]{
            "Name=user", "Value=root", ENDITEM,
            "Name=passwd", "Value=2012", ENDITEM,
            "Name=key", "Value=<OFF>", ENDITEM,
            "LAST"});

    web_submit_form("authenticate",
        "Snapshot=t2.inf",
        ITEMDATA,
            "Name=user", "Value=root", ENDITEM,
            "Name=passwd", "Value=2012", ENDITEM,
            "Name=key", "Value={OFF}", ENDITEM,
        LAST);

  • 相关阅读:
    多数据源源路由方案
    java 异常信息返回
    SQL中只要用到聚合函数就一定要用到group by 吗?
    ASP.NET使用一般处理程序实现上传文本文件后实时读取
    git-删除远程不存在的分支
    Spring Boot-整合Retry框架重试机制
    vue3 Unsupported URL Type “npm:“: npm:vue-loader@^16.0.0-beta.7
    npm : 无法加载文件 D: odejs pm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 http://go.microsoft.com/fwlink
    flutter dio请求DioError [DioErrorType.DEFAULT]: SocketException: Insecure socket connections are disallowed by platform: ****
    Vue Element UI el-table 样式属性重叠发生错位
  • 原文地址:https://www.cnblogs.com/wbw-test/p/11507156.html
Copyright © 2020-2023  润新知