ITeye博客

解决 QTP General Run Error for webElement GetROProperty

jerome_wang · 2012-12-25 10:34 · QTP · 行业应用 · Markdown

现象: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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。