Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Web Table
#4
Solved: 10 Years, 2 Months, 2 Weeks ago
Check out this below snippet
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
Let me know if you have any queries on this
Thanks,
SUpputuri
Reply


Messages In This Thread
Web Table - by debakanta - 02-15-2014, 09:20 PM
RE: Web Table - by supputuri - 02-17-2014, 10:59 PM
RE: Web Table - by anu05446 - 02-18-2014, 12:21 AM
RE: Web Table - by supputuri - 02-19-2014, 11:20 PM
RE: Web Table - by anu05446 - 02-26-2014, 12:12 AM
RE: Web Table - by supputuri - 02-26-2014, 02:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Identify the Button in a Web table spsraj 4 7,363 09-29-2010, 08:24 PM
Last Post: aravindln

Forum Jump:


Users browsing this thread: 1 Guest(s)