pixy3173 发表于 2015-9-29 14:23:22

手动关联一直失败不知道哪里错了,还有Save_count使用后始终不显示count=几

脚本如下:
Action()
{

//关联session
        web_reg_save_param("usersession",
      "LB=userSession value=", "RB=>",
      LAST );

        web_url("WebTours",
                "URL=http://127.0.0.1:1080/WebTours/",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t6.inf",
                "Mode=HTML",
                EXTRARES,
                LAST);

        lr_think_time(9);

    web_reg_find("Text=Welcome",
                        "SaveCount=Welcome_Count",
      LAST );

lr_start_transaction("login");
        web_submit_form("login.pl",
                "Snapshot=t7.inf",
                ITEMDATA,
                //调用session
                "Name=userSession", "Value={usersession}", ENDITEM,
                "Name=username", "Value={username}", ENDITEM,
                "Name=password", "Value={psw}", ENDITEM,
                "Name=login.x", "Value=53", ENDITEM,
                "Name=login.y", "Value=12", ENDITEM,
                LAST);
//判断count>0 则显示登陆成功 反之失败。
        if(atoi(lr_eval_string("{Welcome_Count}")) > 0)
           lr_output_message("登陆成功");
        else
                lr_error_message("登陆失败");
        lr_end_transaction("login", LR_AUTO);

        web_image_check("logoff", "Src=/WebTours/images/signoff.gif", LAST );
        web_image("SignOff Button",
                "Alt=SignOff Button",
                "Snapshot=t8.inf",
                LAST);

        return 0;
}

日志如下
Starting iteration 1.
Starting action Action.
Action.c(5): Registering web_reg_save_param was successful       
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/header.html" in "http://127.0.0.1:1080/WebTours/"       
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" in "http://127.0.0.1:1080/WebTours/"       
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/images/hp_logo.png" in HTML "http://127.0.0.1:1080/WebTours/header.html"       
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/images/webtours.png" in HTML "http://127.0.0.1:1080/WebTours/header.html"       
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?in=home" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"       
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/home.html" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"       
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/JSFormSubmit.js" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home"       
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/images/mer_login.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home"       
Action.c(9): web_url("WebTours") was successful, 6875 body bytes, 1808 header bytes       
Action.c(22): Registering web_reg_find was successful       
Action.c(29): Notify: Transaction "login" started.
Action.c(30): Submitting form to "http://127.0.0.1:1080/WebTours/error.pl", Target Frame="body"       
Action.c(30): Found resource "http://127.0.0.1:1080/WebTours/images/splash_error2.jpg" in HTML "http://127.0.0.1:1080/WebTours/error.pl"       
Action.c(30): Found resource "http://127.0.0.1:1080/WebTours/images/startover.gif" in HTML "http://127.0.0.1:1080/WebTours/error.pl"       
Action.c(30): Warning -26627: HTTP Status-Code=404 (Not found) for "http://127.0.0.1:1080/WebTours/images/startover.gif"       
Action.c(30): Warning -26627: HTTP Status-Code=404 (Not found) for "http://127.0.0.1:1080/WebTours/images/splash_error2.jpg"       
Action.c(30): Registered web_reg_find successful for "Text=Welcome"       
Action.c(30): web_submit_form("login.pl") highest severity level was "warning", 1174 body bytes, 514 header bytes       
Action.c(43): Error: 登陆失败
Action.c(44): Notify: Transaction "login" ended with "Pass" status (Duration: 11.5453 Wasted Time: 0.0020).
Action.c(48): Error -27191: "logoff" failed (0 occurrence(s) found. Alt="", Src="/WebTours/images/signoff.gif")       
Action.c(48): web_image_check highest severity level was "ERROR"       
Ending action Action.
Ending iteration 1.

pixy3173 发表于 2015-9-29 14:25:15

红字部分,我砍别的人即使写错了至少也会显示count=0,而我这个在日志中干脆count=几都不显示。
而且关联的session始终有问题,不知道哪里错了。
请帮帮我谢谢了!

远方的小企鹅 发表于 2015-11-6 15:24:39

同求这个问题,楼主你的解决了吗

pengjun270 发表于 2015-11-6 21:08:34

lr的设置中需要勾选开启文本检查点,你应该是没有开启。至于没有显示count的值是应该是日志设置问题。
页: [1]
查看完整版本: 手动关联一直失败不知道哪里错了,还有Save_count使用后始终不显示count=几