Forum Discussion
HKosova
Alumni
14 years agoHi Vijay,
To handle an item that's currently invisible, you can call the native ensureIndexIsVisible method of the DropDownList control to scroll this item into view. Here's an example:
Let me know how this works for you.
By the way, we've released an update for TestComplete with support for Flex 4.6 and Flash Player 11. So I recommend that you install the new version to take advantage of the new functionality.
To handle an item that's currently invisible, you can call the native ensureIndexIsVisible method of the DropDownList control to scroll this item into view. Here's an example:
set dropdownClick=page.FindChild("ObjectIdentifier","combo_0", 6)
dropdownClick.Click
' Scroll the item into view
set list = ... ' Obtain the DropDownList control
index = ItemIndexByText(list, "Boys")
Call list.FlexObject.ensureIndexIsVisible(index)
set subListitemClick=page.FindChild("ObjectIdentifier","Boys", 6)
subListitemClick.Click
...
' Returns the list item index by its text.
' Parameters:
' DropDownList - a Spark DropDownList control
' ItemText - the list item text
Function ItemIndexByText(DropDownList, ItemText)
Dim i
For i = 0 To DropDownList.ItemCount - 1
If DropDownList.Item(i) = ItemText Then
ItemIndexByText = i
Exit Function
End If
Next
ItemIndexByText = -1
End Function
Let me know how this works for you.
By the way, we've released an update for TestComplete with support for Flex 4.6 and Flash Player 11. So I recommend that you install the new version to take advantage of the new functionality.