Siren_zf520 发表于 2015-3-9 20:27:10

web_reg_find统计检查点次数为null?

代码:
Action()
{

        lr_think_time(2);
       
        lr_start_transaction("login");
       
        lr_rendezvous("yhdl");

        web_submit_data("login_users.htm",
                "Action=http://localhost:81/qckj/login_users.htm",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t81.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=usname", "Value=admin", ENDITEM,
                "Name=uspwd", "Value=admin", ENDITEM,
                "Name=code", "Value=cfbb", ENDITEM,
                "Name=button", "Value= 登录", ENDITEM,
                LAST);

        web_reg_find("Search=Body",
                "SaveCount=Ckeck_Count",
                "Text=How are you",
                LAST);
        lr_output_message("检查点出现次数为:%s",atio(lr_eval_string("{Ckeck_Count}")));
        web_url("page_sysmain_users.htm_2",
                "URL=http://localhost:81/qckj/page_sysmain_users.htm",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t82.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=artDialog4.1.6/skins/simple.css?4.1.6", ENDITEM,
                "URL=My97DatePicker/skin/WdatePicker.css", ENDITEM,
                "URL=images/bottom_bg.jpg", ENDITEM,
                "URL=images/top_h120_right.jpg", ENDITEM,
                "URL=eui/themes/default/images/panel_title.png", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=eui/themes/default/images/blank.gif", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=eui/themes/default/images/layout_button_left.gif", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=images/top_h120.jpg", ENDITEM,
                "URL=eui/themes/default/images/panel_loading.gif", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=eui/themes/default/images/panel_tools.gif", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=images/index_sybg.jpg", ENDITEM,
                "URL=eui/themes/default/images/tree_folder.gif", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=eui/themes/default/images/tree_elbow.png", "Referer=http://localhost:81/qckj/eui/themes/default/easyui.css", ENDITEM,
                "URL=images/paginator_bg_1.png", ENDITEM,
                "URL=images/paginator_bg.png", ENDITEM,
                LAST);

        web_custom_request("show_list_announcement.htm",
                "URL=http://localhost:81/qckj/show_list_announcement.htm?_=1425899335596",
                "Method=GET",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t83.inf",
                "Mode=HTML",
                "EncType=application/x-www-form-urlencoded; charset=UTF-8",
                LAST);

        web_submit_data("findNameByUsid_users.htm",
                "Action=http://localhost:81/qckj/findNameByUsid_users.htm",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t84.inf",
                "Mode=HTML",
                ITEMDATA,
                LAST);

        web_submit_data("findMapSysset_users.htm",
                "Action=http://localhost:81/qckj/findMapSysset_users.htm",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t85.inf",
                "Mode=HTML",
                ITEMDATA,
                LAST);

        web_submit_data("vtimeout_users.htm",
                "Action=http://localhost:81/qckj/vtimeout_users.htm",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t86.inf",
                "Mode=HTML",
                ITEMDATA,
                LAST);

        web_submit_data("my_bypid_menu.htm",
                "Action=http://localhost:81/qckj/my_bypid_menu.htm",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t87.inf",
                "Mode=HTML",
                ITEMDATA,
                LAST);

        web_submit_data("goto.htm",
                "Action=http://localhost:81/qckj/goto.htm?page=mytop",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t88.inf",
                "Mode=HTML",
                ITEMDATA,
                LAST);

        web_submit_data("showAll_announcement.htm",
                "Action=http://localhost:81/qckj/showAll_announcement.htm",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t89.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=acttitle", "Value=", ENDITEM,
                "Name=page", "Value=1", ENDITEM,
                "Name=rows", "Value=20", ENDITEM,
                LAST);

        web_custom_request("comet",
                "URL=http://localhost:81/qckj/comet?cmd=conn&cv=0.0.2&ram=0.8910862379708825",
                "Method=GET",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t90.inf",
                "Mode=HTML",
                "EncType=html/text;charset=UTF8",
                LAST);

        web_url("My97DatePicker.html",
                "URL=http://localhost:81/qckj/My97DatePicker/My97DatePicker.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:81/qckj/page_sysmain_users.htm",
                "Snapshot=t91.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=../artDialog4.1.6/skins/icons/loading.gif", "Referer=http://localhost:81/qckj/artDialog4.1.6/skins/simple.css?4.1.6", ENDITEM,
                "URL=lang/en.js", ENDITEM,
                "URL=skin/default/datepicker.css", ENDITEM,
                "URL=skin/whyGreen/datepicker.css", ENDITEM,
                "URL=skin/default/img.gif", "Referer=http://localhost:81/qckj/My97DatePicker/skin/default/datepicker.css", ENDITEM,
                LAST);
       
        lr_end_transaction("login", LR_AUTO);

return 0;
}

湘西123 发表于 2015-3-10 10:21:32

地壳 发表于 2015-3-10 13:04:45

lr_output_message("检查点出现次数为:%d",atoi(lr_eval_string("{Ckeck_Count}")));
的输出是零;
同时一直提示“The string 'Ckeck_Count' with parameter delimiters is not a parameter”
估计跟LR版本或设置有关,如果楼主只是想查看检查内容次数的话,不妨通过扩展日志进行查看:Run-time Setting——log——Always send messages——Extended log——Parameter Substitution

saharaqs 发表于 2015-3-24 11:06:55

地壳 发表于 2015-3-10 13:04
lr_output_message("检查点出现次数为:%d",atoi(lr_eval_string("{Ckeck_Count}")));
的输出是零;
同 ...

“The string 'Ckeck_Count' with parameter delimiters is not a parameter”

这明明提示的是 'Ckeck_Count' 不是一个参数,跟lr版本或设置没有关系

saharaqs 发表于 2015-3-24 11:11:45

lr_output_message("检查点出现次数为:%s",atio(lr_eval_string("{Ckeck_Count}")));


atio写错了,atoi

lr_output_message("检查点出现次数为:%s",atio(lr_eval_string("{Ckeck_Count}")));
      放在web_url("page_sysmain_users.htm_2",函数的后面去。
页: [1]
查看完整版本: web_reg_find统计检查点次数为null?