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. ' click the button to bring up the modal dialog
  5. Set buttonObj = appObj.findObjectById( "button")
  6. buttonObj.click
  7.  
  8. ' get the content panel from the modal dialog
  9. Set dialogObj = appObj.getModalDialog()
  10. Set contentPanel = dialogObj.getContentPanel()
  11.  
  12. ' get the label panel and button panel from the cotent panel
  13. Set childobjects = contentpanel.getChildObjects()
  14. Set labelPanel = childobjects.elementAt( 0 )
  15. Set buttonPanel = childobjects.elementAt( 1 )
  16.  
  17. ' get and test the first label
  18. Set label = labelPanel.getChildObjectAt( 0 )
  19. text =label.getText()
  20. if( text <> "Number of Columns: ") then
  21.     Reporter.ReportEvent micFail,"Test Label", "Expected 'Number of Columns: '.   Acutal is "+text
  22. Else
  23.     Reporter.ReportEvent micPass,"Test Label", "Got expected result " + text
  24. End If
  25.  
  26. ' get and test the second label
  27. Set label = labelPanel.getChildObjectAt( 2 )
  28. text =label.getText()
  29. if( text <> "Number of Rows: ") then
  30.     Reporter.ReportEvent micFail,"Test Label", "Expected 'Number of Rows: '.   Acutal is "+text
  31. Else
  32.     Reporter.ReportEvent micPass,"Test Label", "Got expected result " + text
  33. End If
  34.  
  35. ' get and test the first  text field
  36. Set textField = labelPanel.getChildObjectAt( 1 )
  37. text =textField.getText()
  38. if( text <> "2") then
  39.     Reporter.ReportEvent micFail,"Test Text Field", "Expected '2'.   Acutal is "+text
  40. Else
  41.     Reporter.ReportEvent micPass,"Test Text Field", "Got expected result " + text
  42. End If
  43.  
  44. ' get and test the second text field
  45. Set textField = labelPanel.getChildObjectAt( 1 )
  46. text =textField.getText()
  47. if( text <> "2") then
  48.     Reporter.ReportEvent micFail,"Test Text Field", "Expected '2'.   Acutal is "+text
  49. Else
  50.     Reporter.ReportEvent micPass,"Test Text Field", "Got expected result " + text
  51. End If
  52.  
  53. ' get OK button from the button pael
  54.  Set okButton = buttonPanel.getChildObjectAt( 0 )
  55.  text =okButton.getText()
  56. if( text <> "OK") then
  57.     Reporter.ReportEvent micFail,"Test OK Button", "Expected 'OK'.   Acutal is "+text
  58. Else
  59.     Reporter.ReportEvent micPass,"Test OK Button", "Got expected result " + text
  60. End If
  61.  
  62. ' get cancel button from the button pael
  63.  Set cancelButton = buttonPanel.getChildObjectAt( 1 )
  64. text =cancelButton.getText()
  65. if( text <> "Cancel") then
  66.     Reporter.ReportEvent micFail,"Test Cancel Button", "Expected 'Canclel'.   Acutal is "+text
  67. Else
  68.     Reporter.ReportEvent micPass,"Test Cancel Button", "Got expected result " + text
  69. End If
  70.  
  71. ' click the ok button to close the dialog
  72.  okButton.click
  73.  

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