QTP UFT Unable to find row count from table

◇◆丶佛笑我妖孽 提交于 2019-12-24 01:24:05

问题


I was not able to find row count of that table and when I spy, Object Respository doesn't show any webtable. Can you please help me on how to find the row count. It was developed in Angular Js framewrok.

Attached Object Repsoitory:

The DOM


回答1:


The elements in the screenshot do not contain a TABLE element (only DIVs). Try running (in the browser's developer tools) document.getElementsByTagName('table') if it returns an empty set then this is the reason UFT isn't showing you a table.

UFT does not recognise Angular tables since they are non-standard. You can add support using WebExtensibility.




回答2:


to get the row count from the table (not simple table its a grid)

Set objDesc = Description.Create
objDesc("micclass").value = "WebElement"
objDesc("class Name").value = "ui-gri-row.*"

Set ObjRows = Browser("").Page("").WebElement("class:=ui-grid-canvas").ChildObjects(objDesc)

msgbox "Row Count : " & objRows.Count


来源:https://stackoverflow.com/questions/41228460/qtp-uft-unable-to-find-row-count-from-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!