求教高手。

2011-12-07  白羽 

我插入文本检查点后,在总是提示这个错误:
vuser_init.c(108): Error -26365: "TextPfx=Welcome," and "TextSfx=,to the Web Tours reservation pages." not found for web_reg_find      [MsgId: MERR-26365]
vuser_init.c(108): Notify: Saving Parameter "welcome_count = 0".
vuser_init.c(108): web_submit_data("login.pl") highest severity level was "ERROR", 795 body bytes, 225 header bytes      [MsgId: MMSG-26388]

我的脚本如下:


    lr_start_transaction("登录");

  web_reg_find("textpfx=Welcome,",
       "textsfx=,to the Web Tours reservation pages.",
        "savecount=welcome_count",
        "fail=NotFound", LAST);

    web_submit_data("login.pl",
        "Action=http://127.0.0.1:1080/WebTours/login.pl",
        "Method=POST",
        "RecContentType=text/html",
        "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
        "Snapshot=t8.inf",
        "Mode=HTML",
        ITEMDATA,
        "Name=userSession", "Value=107180.249007695ffVDAitpAfiDDDDDDDAHipfAtDf", ENDITEM,
        "Name=username", "Value={username}", ENDITEM,
        "Name=password", "Value={password}", ENDITEM,
        "Name=JSFormSubmit", "Value=off", ENDITEM,
        "Name=login.x", "Value=48", ENDITEM,
        "Name=login.y", "Value=10", ENDITEM,
        LAST);

    if (atoi(lr_eval_string("{welcome_Count}"))>0)    
    {lr_output_message("log on successful.");
    }
    else{
    lr_error_message("log on failed.");
       
    }
247°/2418 人阅读/6 条评论 发表评论

小窝  2011-12-07

你是要捕捉页面上的文本吗?如果是的话 尝试改成web_find()


白羽  2011-12-07

谢谢! 但是我还要去判断是否已成功登录了。


白羽  2011-12-07

我原先插入文本检查点是这个:
web_reg_find("Search=Body",
                "Text=Welcome","savecount=welcome_count",
                LAST);

    web_submit_data("login.pl",
                "Action=http://127.0.0.1:1080/WebTours/login.pl",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
                "Snapshot=t8.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=userSession", "Value=107180.249007695ffVDAitpAfiDDDDDDDAHipfAtDf", ENDITEM,
                "Name=username", "Value={username}", ENDITEM,
                "Name=password", "Value={password}", ENDITEM,
                "Name=JSFormSubmit", "Value=off", ENDITEM,
                "Name=login.x", "Value=48", ENDITEM,
                "Name=login.y", "Value=10", ENDITEM,
                LAST);

    if (atoi(lr_eval_string("{welcome_Count}"))>0)     
        {lr_output_message("log on successful.");
        }
    else{
        lr_error_message("log on failed.");
           
        }

但是他的返回值是0, 其实他应该是1.


白羽  2011-12-07

我用的例子是flights这个。


白羽  2011-12-07

并且我还发现有这个提示:
The string 'welcome_Count' with parameter delimiters is not a parameter.


白羽  2011-12-07

这个是什么原因? 


登录 后发表评论