ZhuCrystal 发表于 2010-12-23 17:25:56

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:33

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:44

回复 2# maomao121
THS,I To Try!

ZhuCrystal 发表于 2010-12-24 15:18:51

THS,The problem settled!
Your method is very useful!
页: [1]
查看完整版本: QTP回放时无法识别Link