back to nexaweb
search
Close source view

  1. ' get the app object
  2. Set appObj = Browser("Welcome To Nexaweb").Page("Welcome To Nexaweb").JavaApplet("DefaultJvmDetector").Object.getScriptObject()
  3.  
  4. ' get the tree object
  5. Set treeObj = appObj.findObjectById("simpletree")
  6.  
  7. ' get the number of items
  8. itemcount = treeObj.getItemCount()
  9.  
  10. For i = 0 to itemcout -1
  11.  
  12.    ' get the text and value of the item 
  13.    Set itemObj = treeObj.getItemAt( i )
  14.    text = itemObj.getText()
  15.    val = itemObj.getValue()
  16.  
  17.    ' select an item
  18.    treeObj.selectItemAt( i )
  19.  
  20.    ' get the text and value of the selected item
  21.    Set selectItem = treeObj.getSelectedIItem()
  22.    selText = selectItem.getText()
  23.    selVal = selectItem.getValue()
  24.  
  25.    ' check the text of the item versus the selected item
  26.    if( text <> selText ) Then
  27.        Reporter.ReportEvent micFail,"Text", "Text strings not correct for item #" + i
  28.    End If
  29.  
  30.    ' check the value of the item versus the selected item
  31.    if( val <> selVal ) Then
  32.        Reporter.ReportEvent micFail,"Value", "Values not correct for item #" + i
  33.    End If
  34.    
  35. Next
  36.  
  37. Reporter.ReportEvent micPass,"Items", "All Items checke out correctly"
  38.  

© Copyright 2005-2008 Nexaweb Technologies Inc. All Rights Reserved.