How to check whether drop-down contain duplicate values or not?
Hi All,
I want to know how to check whether drop-down contain duplicate values or not?
I am using Testcomplete version 11.
Also I am uing VB scripts.
My appraoch is first creat an array with all the drop-drown value, then find array contain any duplicate value or not.
I try to creat an array with dropdown values, but I am getting an error saying type mismatch.
For j = 0 To MyObject.wItemCount
MyArray(j) = MyObject.wItem(j)
Next
..................
Thanks
Dev
Hi Colin,
Thanks for your reply.
However I found a solution from some other site, written in VB.
Following is my code.
Sub Check_duplicate()
listcount = myselectobject.wItemCount
listcount = listcount - 1
listone = myselectobject.wItemList
Log.Message "select object list; " & listone
aList = split(myobj1,";")
For x = 0 To listcount
If InStr(sNewList,(aList(x) & ";")) <= 0 Then
sNewList = sNewList & aList(x) & ";"
End If
Next
listtwo = Left(sNewList,Len(sNewList)-1)
Log.Message "select object list; " & listtwo
If listone <> listtwo Then
Log.Message "duplicate found"
Else
Log.Message "No duplicate found"
End IfEnd Sub
...................
Thanks
Dev