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 message dialog
  5. Set dlgObj = appObj.getModalDialog()
  6.  
  7. ' check the title of the message dialog
  8. titleText = dlgObj.getTitle()
  9. if( titleText <> "Test Message Dialog") then
  10.     Reporter.ReportEvent micFail,"Label Text", "Expected 'Test Message Dialog'.   Acutal is "+titleText
  11. Else
  12.     Reporter.ReportEvent micPass,"Label Text", "Got expected result " + titleText
  13. End If
  14.  
  15. ' check the message of the message dialog
  16. messageText = dlgObj.getMessage()
  17. if( messageText <> "A message dialog example") then
  18.     Reporter.ReportEvent micFail,"Label Text", "Expected 'A message dialog example'.   Acutal is "+messageText
  19. Else
  20.     Reporter.ReportEvent micPass,"Label Text", "Got expected result " + messageText
  21. End If
  22.  
  23. ' get the first button
  24. Set buttonObj = dlgObj.getButton( 0 )
  25.  
  26. ' check the text to see if it is the OK button
  27. buttonText = buttonObj.getText()
  28. if( buttonText <> "OK") then
  29.     Reporter.ReportEvent micFail,"Label Text", "Expected 'OK'.   Acutal is "+buttonText
  30. Else
  31.     Reporter.ReportEvent micPass,"Label Text", "Got expected result " + buttonText
  32. End If
  33.  
  34. ' click the button to close the dialog
  35. buttonObj.click
  36.  

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