02-19-2014, 11:20 PM
Check out this below snippet
Let me know if you have any queries on this
Code:
'********************************************
''My Search Item
sSearchItem = "s" 'Change this based on your interest
'*********************************************
Set oGetAlp = Description.Create()
oGetAlp("html tag").value = "TR"
oGetAlp("innertext").Value = ".*" & sSearchItem &".*"
Set oRows = Browser("QTP Forums - Search Results").Page("QTP Forums - Search Results").WebTable("Search Results").ChildObjects(oGetAlp)
Set oGetColAlp = Description.Create()
oGetColAlp("html tag").value = "TD"
oGetColAlp("innertext").Value = ".*" & sSearchItem &".*"
iRows = oRows.Count
For i = 0 to oRows.Count-1
'msgbox oRows(i).GetROProperty("innertext")
Set oTD = oRows(i).ChildObjectS(oGetColAlp)
For j = 0 to oTD.Count-1
sTDValue = oTD(j).GetROProperty("innertext")
NumOccurances = NumOccurances+(len(sTDValue)-Len(Replace(sTDValue,sSearchItem,"")))
Next
iCols = iCols+ oTD.Count
Next
print "Total Number of Rows with " & sSearchItem & ": "& iRows
print "Total Number of Columns with " & sSearchItem & ": " & iCols
Print "Total Number of Occurances of " & sSearchItem & ": " & NumOccurances
Thanks,
SUpputuri
SUpputuri