Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check for duplicate rows/items in table?
#5
Not Solved
I'm not sure if I did it correctly.
But when I run my test nth happen..
here's my code..
(my table row default value is 1)
I dunno where is the problem..

Code:
nTotalRow = Browser("bwTPeSA").Page("bwTPeSA.pgMySub").WebTable("bwTPeSA.mySub.tblSubjects").RowCount
MsgBox  nTotalRow
Function ComapreTableElement(nTotalRow)
If (nTotalRow = 1 Or nTotalRow = 2) Then
blnStatus = False
End If
For intItemCntx = 2 To nTotalRow
strGetVal1 =Browser("bwTPeSA").Page("bwTPeSA.pgMySub").WebTable("bwTPeSA.mySub.tblSubjects").GetCellData(intItemCntx, 4)
For intItemCnty = intItemCntx + 1 To nTotalRow
strGetVal2 = Browser("bwTPeSA").Page("bwTPeSA.pgMySub").WebTable("bwTPeSA.mySub.tblSubjects").GetCellData(intItemCnty, 4)
If (StrComp(strGetVal1, strGetVal2, VbTextCompare) = 0) Then
blnStatus = False
MsgBox "No Duplicate"
Exit For
Else
blnStatus = True
MsgBox"Duplicate"
End If
Next
If (blnStatus = False) Then
Exit For
End If
Next
ComapreTableElement = blnStatus
End Function
Reply


Messages In This Thread
RE: How to check for duplicate rows/items in table? - by Aestival - 08-03-2010, 01:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to fetch items from WpfList in UFT saurabhkumar_gupta 0 2,441 03-08-2015, 09:17 PM
Last Post: saurabhkumar_gupta
  How to Delete Rows with duplicate values in 1 columns in excel thru QTP. arpan 0 2,804 02-09-2015, 08:47 PM
Last Post: arpan
  Can't locate items on Win7 Desktop RandomGrin 0 2,070 01-30-2015, 10:55 PM
Last Post: RandomGrin
  How to get center data value in a odd number of rows and columns web table ... sai rajesh 0 2,787 11-13-2013, 10:24 PM
Last Post: sai rajesh
  to count the number of used rows in a particular column sujaravi123 3 11,149 06-12-2013, 03:17 PM
Last Post: sujaravi123

Forum Jump:


Users browsing this thread: 3 Guest(s)