DevPereraOccasional ContributorJoined 10 years ago11 Posts2 LikesLikes received1 SolutionView All Badges
ContributionsMost RecentMost LikesSolutionsRe: How to check whether drop-down contain duplicate values or not? 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 If End Sub ................... Thanks Dev Re: How to check whether drop-down contain duplicate values or not? Hi Alex, Thanks for the reply, but I didnt know how to use "HISUtils" to find duplicate values. If you can share some code example its whould be great help for me. ............. Thanks Dev 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 SolvedRe: I am getting more object number than actual values when I try to get text fields object counts Hi Colin, Thanks for the repley. I divide the total number by two which return by object counter. Ex; if a page contain object count as one, then function return as two, then I divide that value by two to get correct. ------------ Thanks Dev Re: I am getting more object number than actual values when I try to get text fields object counts Hi Colin, I tried your suggestion but its not work. Then I change my code to see all the results its been count as objects. By looking at the results I can see its duplicate the objects. Ex; If only one object found then its dispay as two like wise. System results attach here with. Modified code as below. Sub ObjCounts PropArray = Array("ObjectType", "Exists", "VisibleOnScreen", "Visible", "Enabled") ValuesArray = Array("Textbox", "True", "True", "True", "True") obj = Sys.Browser("iexplore").FindAllChildren(PropArray, ValuesArray,2000) If UBound(obj) > 0 Then Log.Message("Total number of text fields : " & (UBound(obj)+1)) For i = 0 To UBound(obj) Log.Message("Object_ID:" & i & "; ObjectType: " & obj(i).ObjectType & ", ObjectIdentifier: " & obj(i).ObjectIdentifier) Next Else Log.Warning("No text fields found!") End If End Sub I am getting more object number than actual values when I try to get text fields object counts Hi All, I just want to get number of text fields on particular web page. Issue is I am getting more number than actual values. Example if web page contain five text fields, then I am getting count as nine. Here is code written in VB scripts. Sub CountTextFields PropArray = Array("ObjectType", "Exists", "VisibleOnScreen", "Visible", "Enabled") ValuesArray = Array("Textbox", "True", "True", "True", "True") obj = Sys.Browser("iexplore").FindAllChildren(PropArray, ValuesArray,2000) If UBound(obj) >= 0 Then Log.Message("Total number of text fields : " & (UBound(obj))) Else Log.Warning("No text fields found!") End If End Sub ................ Thanks Dev Re: How to check whether particular Folder exists or not? Hi HKosova, Thanks For the reply. I am using VB scripts, so use you code as below and its works. Sub checkforfolder If aqFileSystem.Exists("C:\Folder1\Folder2") Then Log.Message "C:\Folder1\Folder2 path exsist" Else Log.Message "C:\Folder1\Folder2 path NOT found!" End If End Sub ......................... Thanks Dev How to get sub folder names one by one which are inside a given folder? Hi All, I just want to get all the sub folder names which is inside a give folder, dont know how to do it? .................. Thanks Dev SolvedHow to open particular Folder? Hi All, I just want to open a folder in windows 7 machine and I am using Testcomplete 10.0. ....................... Thanks Dev SolvedHow to check whether particular Folder exists or not? Hi All, How to check whether particular folder exsist or not. This is not about checking a file exsist or not only checking the folder. ...................... Thanks Dev Solved