Hello Vince,
Does TestComplete support the Yahoo.widget.TreeView ? |
Currently, TestComplete does not support this control. If you are interested in implementing support for this control (and other Yahoo controls) in TestComplete, you can vote for this control on the following web page: TestComplete Feature Survey.
Thank you.
Oddly enough, tehre are more than 500 items that should match this, but TC only finds like 6... sometimes just 3... what's wrong with this code? |
I failed to reproduce the behavior you describe. This problem may be specific to your application under test. Could you please use this Contact Support web form to send us your project and application (or a sample application demonstrating the problem)? That would help us to reproduce the problem.
Thanks in advance.
Also, to access items of the tree view, you can try finding them by their class name (ygtvitem) or caption text (specified by the innerText property). For example, the following sample code iterates through tree view items and expands them if they are collapsed:
Sub Test
URL = http://developer.yahoo.com/yui/examples/treeview/folder_style_clean.html
' Obtains the tree view object and processes all of its items
Set TreeObj = Sys.Process("iexplore").Page(URL).Panel("treeDiv1").Panel("ygtv0").Panel("ygtvc0")
ProcessItems(TreeObj)
End Sub
Sub ProcessItems(Obj)
Dim PropArray, ValuesArray, Children, InnerChildren, Table, Spacer
PropArray = Array("className")
ValuesArray = Array("ygtvitem")
' Obtains the collection of tree view items
Children = Obj.FindAllChildren(PropArray, ValuesArray, 1)
For i = 0 To Ubound(Children)
' Checks whether the item has child subitems
PropArray = Array("className")
ValuesArray = Array("ygtvchildren")
Set InnerChildren = Children(i).FindChild(PropArray, ValuesArray, 1)
If InnerChildren.Exists Then
If InnerChildren.ChildCount > 0 Then
' Checks whether the subitems are visible on the screen
If Not InnerChildren.VisibleOnScreen Then
If Not InnerChildren.Visible Then
PropArray = Array("className")
ValuesArray = Array("ygtvtable*")
Set Table = Children(i).FindChild(PropArray, ValuesArray, 1)
If Table.Exists Then
PropArray = Array("className")
ValuesArray = Array("ygtvspacer")
Set Spacer = Table.FindChild(PropArray, ValuesArray, 2)
If Spacer.Exists Then
' Expands the item
Spacer.Click
End If
End If
End If
End If
' Processes the current item's subitems
ProcessItems(InnerChildren)
End If
End If
Next
End Sub
Or instead of the FindAllChildren method you can use the EvaluateXPath method to get tree view items.
For example, the following sample code obtains all A elements whose class attribute is set to "ygtvspacer" and then simulates a click on each element:
Sub Test
URL = "http://developer.yahoo.com/yui/examples/treeview/folder_style_clean.html"
Set Page = Sys.Process("iexplore").Page(URL)
Nodes = Page.EvaluateXPath("//A[@class='ygtvspacer']")
If VarType(Nodes) <> varNull Then
For i = 0 To UBound(Nodes)
Nodes(i).Click
Next
End If
End Sub
I hope this information helps you. Please let us know if you have any additional questions.
Good luck.