【发布时间】:2014-02-03 19:50:53
【问题描述】:
我在 QTP 中使用视觉关系标识符在 webedit 中设置值。这是我的代码
Set rc = VisualRelations.Create
Set relation = rc.Add
relation.relatedobjectpath = "Browser(""ABC"").Page(""XYZ"").WebElement(""innertext:=E-Mail ID"")"
relation.relativeposition = micRelLeft
relation.setargument micrelinline, True
Set des=Description.Create
des.Add "micclass","WebEdit"
des.Add "visual relations",rc
Browser("ABC").Page("XYZ").WebEdit(des).set "qtpuser@abc.com"
Set relation = Nothing
Set rc = Nothing
问题是当我在第 3 行中对 webElement 使用描述编程时,QTP 显示错误消息“找不到“webedit”对象父级”。但是,当我在 OR 中存储 webelement "E-Mail id" 时,代码运行良好,没有任何错误。
你能告诉我在这种情况下我能做些什么来解决这个问题吗? 提前致谢:)
【问题讨论】: