Micro Focus QTP (UFT) Forums
How to count no of Webelement in a WebTable? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to count no of Webelement in a WebTable? (/Thread-How-to-count-no-of-Webelement-in-a-WebTable)



How to count no of Webelement in a WebTable? - Akhila - 10-08-2013

Hi There,

I couldn't able to find no of Webelements present in a WebTable using childobjects and Getroproperty methods
--The specific WebTable contains 43 objects...and there are many webElements but it returns 0....Any idea where I am making mistake.

Code:
Set oWT= Description.Create()
     oWT("html tag").value = "TABLE"
     oWT("INDEX").value = 2

set objs= Browser("creationtime:=0").page("title:=.*").WebTable(oWT).childobjects
cnt = objs.count

    c=0
    For i = 0 to cnt-1
      If  objs(i).getroproperty("micClass") = "WebElement " then
      c = c+1
      end if
    Next
    msgbox "Print no of Weblemetns are " &c



RE: How to count no of Webelement in a WebTable? - Parke - 10-11-2013

The problem is in the "WebElement ". It should be "WebElement". The extra space is a killer. I tried your code without the space and it worked perfectly

Parke