zll_618 发表于 2013-1-10 10:11:49

LR关于lr_output_message()函数

录制了一个新增提交的脚本,增加了文本检查点,参数化,也做了关联。参数化采用的是按顺序进行迭代,每次迭代箱号是不能重复的。想在回放时判断是否成功,加了一个if判断语句。在回放时,replay log显示提交失败,实际是已经成功了。请各位高手帮忙看一下是怎么回事?
web_reg_find("Search=Body",
                "SaveCount=SubmitCdowncount",
                "Text=成功添加",
                LAST);
        web_submit_data("decWeightImpExpReport.do_4",
                "Action=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do?method=addContainerTo",
                "Snapshot=t57.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=method", "Value=addContainerEnd", ENDITEM,
                "Name=cargoType", "Value=1", ENDITEM,
                "Name=fieldtmp", "Value=7209000001", ENDITEM,
                "Name=tradeTypeImp", "Value=", ENDITEM,
                "Name=tradeTypeExp", "Value=", ENDITEM,
                "Name=org.apache.struts.taglib.html.TOKEN", "Value={CorrelationParameter_1}", ENDITEM,
                "Name=decImportLadingBill.icCardNo", "Value=1000000003", ENDITEM,
                "Name=decImportLadingBill.fieldId", "Value=7209000001", ENDITEM,
                "Name=decImportLadingBill.tradeExpType", "Value=1", ENDITEM,
                "Name=decImportLadingBill.tradeType", "Value=1", ENDITEM,
                "Name=decImportLadingBill.exceptive", "Value=0", ENDITEM,
                "Name=decImportLadingBill.carNum", "Value=123456", ENDITEM,
                "Name=decImportLadingBill.vehicleWeight", "Value=3000", ENDITEM,
                "Name=decImportLadingBill.remark", "Value=", ENDITEM,
                "Name=containerNumImp", "Value={container}", ENDITEM,
                "Name=containerWeightImp", "Value=5000", ENDITEM,
                "Name=containerSizeImp", "Value=40", ENDITEM,
                "Name=emptyFlagImp", "Value=0", ENDITEM,
                "Name=containerNumExp", "Value={containerE}", ENDITEM,
                "Name=tradeTypeConExp", "Value=undefined", ENDITEM,
                "Name=IEFlagConExp", "Value=undefined", ENDITEM,
                "Name=containerWeightExp", "Value=3800.0", ENDITEM,
                "Name=containerSizeExp", "Value=20", ENDITEM,
                "Name=emptyFlagExp", "Value=0", ENDITEM,
                "Name=transFlagExp", "Value=0", ENDITEM,
                "Name=button", "Value=?", ENDITEM,
                LAST);

        web_concurrent_start(NULL);

        web_url("rightTitleBg.gif_3",
                "URL=http://172.18.11.193:8080/nnfx/images/rightTitleBg.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do",
                "Snapshot=t58.inf",
                LAST);

        web_url("buttonBg1.gif_3",
                "URL=http://172.18.11.193:8080/nnfx/images/buttonBg1.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do",
                "Snapshot=t59.inf",
                LAST);

        web_concurrent_end(NULL);

        web_url("decWeightImpExpReport.do_5",
                "URL=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do?method={CorrelationParameter_2}Container{CorrelationParameter_3}",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://172.18.11.193:8080/nnfx/right_default.jsp",
                "Snapshot=t60.inf",
                "Mode=HTML",
                LAST);

        web_concurrent_start(NULL);

        web_url("WdatePicker.css_3",
                "URL=http://172.18.11.193:8080/nnfx/js/My97DatePicker/skin/WdatePicker.css",
                "Resource=1",
                "RecContentType=text/css",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do?method={CorrelationParameter_2}Container{CorrelationParameter_3}",
                "Snapshot=t61.inf",
                LAST);

        web_url("background-title.gif_3",
                "URL=http://172.18.11.193:8080/nnfx/images/background-title.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do?method={CorrelationParameter_2}Container{CorrelationParameter_3}",
                "Snapshot=t62.inf",
                LAST);

        web_url("titlebga.gif",
                "URL=http://172.18.11.193:8080/nnfx/images/titlebga.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do?method={CorrelationParameter_2}Container{CorrelationParameter_3}",
                "Snapshot=t63.inf",
                LAST);

        web_url("buttonBg1.gif_4",
                "URL=http://172.18.11.193:8080/nnfx/images/buttonBg1.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://172.18.11.193:8080/nnfx/dec_import/decWeightImpExpReport.do?method={CorrelationParameter_2}Container{CorrelationParameter_3}",
                "Snapshot=t64.inf",
                LAST);

        web_concurrent_end(NULL);

        if(atoi(lr_eval_string("{SubmitCdowncount}"))>0)
        {
        lr_output_message("提交集装箱业务申报成功!");
        }
    else
        {
        lr_output_message("提交集装箱业务申报失败!");
        }

thirfing 发表于 2013-1-10 14:23:56

函数本身没有错误,检查函数位置和业务是否实际成功

ffwithvv 发表于 2013-1-10 15:43:08

检查SubmitCdowncount的值,建议脚本单步调试

linlin547 发表于 2013-1-11 15:06:02

查看是否开启 utf-8 ,不开启中文检查点是出错的

msnshow 发表于 2013-1-12 22:18:15

打开display窗口看看
页: [1]
查看完整版本: LR关于lr_output_message()函数