' get the app object
Set appObj = Browser("Welcome To Nexaweb").Page("Welcome To Nexaweb").JavaApplet("DefaultJvmDetector").Object.getScriptObject()
' get the tree object
Set treeObj = appObj.findObjectById("simpletree")
' get the number of items
itemcount = treeObj.getItemCount()
For i = 0 to itemcout -1
' get the text and value of the item
Set itemObj = treeObj.getItemAt( i )
text = itemObj.getText()
val = itemObj.getValue()
' select an item
treeObj.selectItemAt( i )
' get the text and value of the selected item
Set selectItem = treeObj.getSelectedIItem()
selText = selectItem.getText()
selVal = selectItem.getValue()
' check the text of the item versus the selected item
if( text <> selText ) Then
Reporter.ReportEvent micFail,"Text", "Text strings not correct for item #" + i
End If
' check the value of the item versus the selected item
if( val <> selVal ) Then
Reporter.ReportEvent micFail,"Value", "Values not correct for item #" + i
End If
Next
Reporter.ReportEvent micPass,"Items", "All Items checke out correctly"