Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check for duplicate rows/items in table?
#6
Not Solved
..............................................................................................
I did one mistake in the script. I didn't use the Exit Function statement when the row count is 0 or 1 as that point of time we don't need to compare.

Code:
intRowCnt = Object.Table().RowCount

Public Function Comapre_Table_Element(intRowCnt)

If (intRowCnt = 0 Or intRowCnt = 1) Then

blnStatus = False

Exit Function

End If

For intItemCntx = 0 To intRowCnt - 1

strGetVal1 = Object.Table().GetCellData(intItemCntx, "Level")

For intItemCnty = intItemCntx + 1 To intRowCnt - 1

strGetVal2 = Object.Table().GetCellData(intItemCnty, "Level")

If (StrComp(strGetVal1, strGetVal2, VbTextCompare) = 0) Then

blnStatus = False

Exit For

Else

blnStatus = True

End If

Next

If (blnStatus = False) Then

Exit For

End If

Next

Comapre_Table_Element = blnStatus

End Function
Reply


Messages In This Thread
RE: How to check for duplicate rows/items in table? - by guin.anirban - 08-03-2010, 01:26 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)