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 table object
  5. Set tableObj = appObj.findObjectById("EditTable")
  6.  
  7. ' select some cells
  8. tableObj.selectCellAt 1, 1
  9. tableObj.selectCellAt 2, 0
  10. tableObj.selectCellAt 2, 1
  11.  
  12. ' double click on a cell to put it into edit mode
  13. tableObj.doubleClickCellAt 0, 1
  14.  
  15. ' enter new text by using app object fireKeys() and fireKey()
  16. appObj.fireKeys("A new value")
  17. appObj.fireKey("Enter")
  18.  
  19.  
  20. ' navigate through table with arrow keys
  21. appObj.fireKey("Down")
  22. appObj.fireKey("Down")
  23. appObj.fireKey("Left")
  24.  
  25. ' edit cell using table obj edit cell
  26. tableObj.editCellAt 0, 1, "Something else"
  27.  
  28. ' get cell that was just edited
  29. Set obj = tableObj.getObjectAt( 0, 1 )
  30.  
  31. ' test the text of the cell that was edited
  32. cellText = obj.getText()
  33. if( cellText <> "Something else" ) then
  34.     Reporter.ReportEvent micFail,"Edit Cell", "Expected text to be 'Something else'.   Text was actually " + cellText
  35. End if
  36.  
  37. Reporter.ReportEvent micPass,"Edit Cell", "Cell was edited correctly"
  38.  

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