脚本运行结果为Done,是为什么??
我写了一些LR脚本,运行,查看TestResults,结果发现Web_reg_find检查点的结果为Done,这是为什么,我知道Pass表示通过,Fail表示失败。 为什么没人回复,有人能帮帮我吗?:) 本帖最后由 twinsczl 于 2010-12-14 16:20 编辑Web_reg_find 被执行了,但没找到相应的文本
检查脚本是否报错了
例如你写了Web_reg_find 但没有访问页面
------
把相关的脚本贴出来看看 回复 3# twinsczl
Action()
{
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_link("sign up now",
"Text=sign up now",
"Snapshot=t2.inf",
LAST);
web_reg_find("Search=Body",
"Text={NewParam}",
LAST);
web_submit_form("login.pl",
"Snapshot=t3.inf",
ITEMDATA,
"Name=username", "Value={NewParam}", ENDITEM,
"Name=password", "Value=zmx21", ENDITEM,
"Name=passwordConfirm", "Value=zmx21", ENDITEM,
"Name=firstName", "Value=zmx21", ENDITEM,
"Name=lastName", "Value=zmx21", ENDITEM,
"Name=address1", "Value=zmx21", ENDITEM,
"Name=address2", "Value=zmx21", ENDITEM,
"Name=register.x", "Value=51", ENDITEM,
"Name=register.y", "Value=7", ENDITEM,
LAST);
web_image("button_next.gif",
"Src=/WebTours/images/button_next.gif",
"Snapshot=t4.inf",
LAST);
return 0;
} 在TestResults中,Web_reg_find的执行是显示Done,没错的
在其后的页面中,是否找到了对应的值,则显示Pass OR Fail 本帖最后由 章美霞 于 2010-12-14 17:28 编辑
回复 5# twinsczl
你的意思是说:Web_reg_find执行了,那么执行结果为Done,在其后的页面中,如果找到了对应的值,则显示Pass OR Fail,对吗。那我还有下面一段脚本,用的是web_find,请帮忙看下。问题是在TestResults中无法查看到我添加的Web_find,且"Submit Form :login.pl"执行结果同样为Done,其Details为“param not to passed in call”,见截图。
Action()
{
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t5.inf",
"Mode=HTML",
LAST);
lr_rendezvous("Regeist");
lr_start_transaction("Regeist_tran");
web_link("sign up now",
"Text=sign up now",
"Snapshot=t6.inf",
LAST);
web_submit_form("login.pl",
"Snapshot=t7.inf",
ITEMDATA,
"Name=username", "Value={NewParam}", ENDITEM,
"Name=password", "Value=111111", ENDITEM,
"Name=passwordConfirm", "Value=111111", ENDITEM,
"Name=firstName", "Value=zmx06", ENDITEM,
"Name=lastName", "Value=zmx06", ENDITEM,
"Name=address1", "Value=zmx06", ENDITEM,
"Name=address2", "Value=zmx06", ENDITEM,
"Name=register.x", "Value=61", ENDITEM,
"Name=register.y", "Value=9", ENDITEM,
LAST);
web_find("CheckPointOfname",
"what={NewParam}",
LAST);
web_image("button_next.gif",
"Src=/WebTours/images/button_next.gif",
"Snapshot=t8.inf",
LAST);
lr_end_transaction("Regeist_tran", LR_AUTO);
return 0;
} web_find 如果没有显示
那你要检查Run-time Settings>Internet Protocol>Preferences
Checks 是否启用了 回复 7# twinsczl
非常感谢,我没勾选你所说的那个选项,不过我还有个问题,刚刚重新勾上了后,在TestResults中web_find的结果也为Done,这是不是说,表示该函数执行了,要看其前面的页面是否找到了对应的值,如果找到了,就显示PASS
页:
[1]