' get the app object
Set appObj = Browser("Welcome To Nexaweb").Page("Welcome To Nexaweb").JavaApplet("DefaultJvmDetector").Object.getScriptObject()
' get the message dialog
Set dlgObj = appObj.getModalDialog()
' check the title of the message dialog
titleText = dlgObj.getTitle()
if( titleText <> "Test Message Dialog") then
Reporter.ReportEvent micFail,"Label Text", "Expected 'Test Message Dialog'. Acutal is "+titleText
Else
Reporter.ReportEvent micPass,"Label Text", "Got expected result " + titleText
End If
' check the message of the message dialog
messageText = dlgObj.getMessage()
if( messageText <> "A message dialog example") then
Reporter.ReportEvent micFail,"Label Text", "Expected 'A message dialog example'. Acutal is "+messageText
Else
Reporter.ReportEvent micPass,"Label Text", "Got expected result " + messageText
End If
' get the first button
Set buttonObj = dlgObj.getButton( 0 )
' check the text to see if it is the OK button
buttonText = buttonObj.getText()
if( buttonText <> "OK") then
Reporter.ReportEvent micFail,"Label Text", "Expected 'OK'. Acutal is "+buttonText
Else
Reporter.ReportEvent micPass,"Label Text", "Got expected result " + buttonText
End If
' click the button to close the dialog
buttonObj.click