51Testing软件测试论坛

标题: QTP回放时无法识别Link [打印本页]

作者: ZhuCrystal    时间: 2010-12-23 17:25
标题: QTP回放时无法识别Link
我在回放相关脚本时,QTP直接提示,无法找到Link对象;详细信息如下。请各位高手指点下,感激不尽!先行谢过了!

直接报错:Cannot find the "[ Link ]" object's parent "[ Browser ]" (class Browser). Verify that parent properties match an object currently displayed in your application.
Line (38): "Browser("title:=Retech LMS2.0","name:=Retech LMS2.0").Page("titile:=问卷库管理","url:=http://192.168.4.5:9999/Survey/SurveyExampaper.aspx").Link("text:=问卷库管理").Click".

这是我试过的几种方法,都没有解决此问题:
(1)通过GetROProperty读取属性Text,赋予变量paly来定位;
'play=Browser("title:=Retech LMS2.0","name:=Retech LMS2.0").Page("titile:=问卷库管理","name:=问卷库管理").Link("text:=问卷库管理").GetROProperty("text")
'Browser("title:=Retech LMS2.0","name:=Retech LMS2.0").Page("titile:=问卷库管理").Link("text:="&play).Click
(2)修改对象库中对应的描述属性(去掉text,添加url);
Browser("title:=Retech LMS2.0","name:=Retech LMS2.0").Page("titile:=问卷库管理").Link("url:=javascript:__doPostBack('ctl00$ContentPlaceHolder1$Button1','')","html id:=ctl00_ContentPlaceHolder1_Button1","html tag:=A").Click
作者: maomao121    时间: 2010-12-24 09:22
I had similiar problem before. I added a WAIT before clicking the LINK object. The fault was then solved. Not sure whether it is useful for your case.
作者: ZhuCrystal    时间: 2010-12-24 09:51
回复 2# maomao121
THS,I To Try!
作者: ZhuCrystal    时间: 2010-12-24 15:18
THS,The problem settled!
Your method is very useful!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2