`
jerome_wang
  • 浏览: 149810 次
  • 性别: Icon_minigender_1
  • 来自: 云南
社区版块
存档分类
最新评论

解决 QTP General Run Error for webElement GetROProperty

    博客分类:
  • QTP
 
阅读更多

现象:QTP 中 遍历对象为 welement对象是 会出现 General Run error

原因:WebElement catches all sorts of things and some may cause the General run error (still a bug with the tool).

 

解决方案:

Set wElement=Description.Create()
wElement("micclass").Value="WebElement"
wElement("html tag").Value="DIV" '根据实际情况添加 

Set cElements=Browser(myBrowser).Page(myPage).ChildObjects(wElement)
ElementsCount=cElements.count()
For i=0 to ElementsCount-1
msgbox cElements(i).GetROProperty("innertext")
If cElements(i).GetROProperty("innertext") = elementName Then
myY = cElements(i).GetROProperty("y")
Exit for
End If
Next

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics