03-01-2013, 11:04 AM
Code:
arrCtry=Split(Browser("name:=QTP").Page("title:=QTP").WebList("name:=select1").GetROProperty("all items"),";")
Set objArray=DotNetFactory.CreateInstance("System.Collections.ArrayList","")
For i=0 to Ubound(arrCtry)
If arrCtry(i)<>"--Choose One--" Then
objArray.Add(arrCtry(i))
End If
Next
objArray.Sort()
objArray.Insert 0,"--Choose One--"
For j=0 to Ubound(arrCtry)
strOuput=strOuput+objArray(j)
strOuput=strOuput+";"
Next
If strOuput=Browser("name:=QTP").Page("title:=QTP").WebList("name:=select1").GetROProperty("all items")+";" Then
Msgbox "The Weblist's values are sorted in alphabetical order"
Else
Msgbox "The Weblist's values are not sorted in alphabetical order"
End If