' get the app object
Set appObj = Browser("Welcome To Nexaweb").Page("Welcome To Nexaweb").JavaApplet("DefaultJvmDetector").Object.getScriptObject()
' click the button to bring up the modal dialog
Set buttonObj = appObj.findObjectById( "button")
buttonObj.click
' get the content panel from the modal dialog
Set dialogObj = appObj.getModalDialog()
Set contentPanel = dialogObj.getContentPanel()
' get the label panel and button panel from the cotent panel
Set childobjects = contentpanel.getChildObjects()
Set labelPanel = childobjects.elementAt( 0 )
Set buttonPanel = childobjects.elementAt( 1 )
' get and test the first label
Set label = labelPanel.getChildObjectAt( 0 )
text =label.getText()
if( text <> "Number of Columns: ") then
Reporter.ReportEvent micFail,"Test Label", "Expected 'Number of Columns: '. Acutal is "+text
Else
Reporter.ReportEvent micPass,"Test Label", "Got expected result " + text
End If
' get and test the second label
Set label = labelPanel.getChildObjectAt( 2 )
text =label.getText()
if( text <> "Number of Rows: ") then
Reporter.ReportEvent micFail,"Test Label", "Expected 'Number of Rows: '. Acutal is "+text
Else
Reporter.ReportEvent micPass,"Test Label", "Got expected result " + text
End If
' get and test the first text field
Set textField = labelPanel.getChildObjectAt( 1 )
text =textField.getText()
if( text <> "2") then
Reporter.ReportEvent micFail,"Test Text Field", "Expected '2'. Acutal is "+text
Else
Reporter.ReportEvent micPass,"Test Text Field", "Got expected result " + text
End If
' get and test the second text field
Set textField = labelPanel.getChildObjectAt( 1 )
text =textField.getText()
if( text <> "2") then
Reporter.ReportEvent micFail,"Test Text Field", "Expected '2'. Acutal is "+text
Else
Reporter.ReportEvent micPass,"Test Text Field", "Got expected result " + text
End If
' get OK button from the button pael
Set okButton = buttonPanel.getChildObjectAt( 0 )
text =okButton.getText()
if( text <> "OK") then
Reporter.ReportEvent micFail,"Test OK Button", "Expected 'OK'. Acutal is "+text
Else
Reporter.ReportEvent micPass,"Test OK Button", "Got expected result " + text
End If
' get cancel button from the button pael
Set cancelButton = buttonPanel.getChildObjectAt( 1 )
text =cancelButton.getText()
if( text <> "Cancel") then
Reporter.ReportEvent micFail,"Test Cancel Button", "Expected 'Canclel'. Acutal is "+text
Else
Reporter.ReportEvent micPass,"Test Cancel Button", "Got expected result " + text
End If
' click the ok button to close the dialog
okButton.click