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 window
  5. Set windowObj = appObj.getWindowAt( 0 )
  6.  
  7. ' get the content panel
  8. Set contents = windowObj.getContentPanel()
  9.  
  10. ' get the label subpanel and get the label being set by the buttons
  11. Set labelPanel = contents.getChildObjectAt( 1 )
  12. Set checkLabel = appObj.findObject( labelPanel, "/label[@id='clicklabel']" )
  13.  
  14. ' get the button panel
  15. Set buttonPanel = contents.getChildObjectAt( 0 )
  16.  
  17. ' click the first button
  18. Set buttonObj = buttonPanel.getChildObjectAt( 0 )
  19. buttonObj.click
  20.  
  21. ' test the label to ensure the code behind the button was fired correctly
  22. labelText = checkLabel.getText()
  23. if( labelText <> "Button 1 Clicked") then
  24.     Reporter.ReportEvent micFail,"Label Text", "Expected 'Button 1 Clicked'.   Acutal is "+labelText
  25. Else
  26.     Reporter.ReportEvent micPass,"Label Text", "Got expected result " + labelText
  27. End If
  28.  
  29. ' click the second button
  30. Set buttonObj = buttonPanel.getChildObjectAt( 1 )
  31. buttonObj.click
  32.  
  33. ' test the label to ensure the code behind the button was fired correctly
  34. labelText = checkLabel.getText()
  35. if( labelText <> "Button 2 Clicked") then
  36.     Reporter.ReportEvent micFail,"Label Text", "Expected 'Button 2 Clicked'.   Acutal is "+labelText
  37. Else
  38.     Reporter.ReportEvent micPass,"Label Text", "Got expected result " + labelText
  39. End If
  40.  
  41. ' click the third button
  42. Set buttonObj = buttonPanel.getChildObjectAt( 2 )
  43. buttonObj.click
  44.  
  45. ' test the label to ensure the code behind the button was fired correctly
  46. labelText = checkLabel.getText()
  47. if( labelText <> "Button 3 Clicked") then
  48.     Reporter.ReportEvent micFail,"Label Text", "Expected 'Button 3 Clicked'.   Acutal is "+labelText
  49. Else
  50.     Reporter.ReportEvent micPass,"Label Text", "Got expected result " + labelText
  51. End If
  52.  

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