' get the app object
Set appObj = Browser("Welcome To Nexaweb").Page("Welcome To Nexaweb").JavaApplet("DefaultJvmDetector").Object.getScriptObject()
' get the buttons in the app
Set labelObj = appObj.findObjectById( "labelWithPopupMenu" )
Set textFieldObj = appObj.findObjectById( "tfReport" )
' right click to get popup menu
labelObj.fireRightMouseClick
' get the popup menu
Set popupMenu = appObj.getPopup()
' get the first menu item
Set menuItem = popupMenu.getMenuItemAt( 0 )
'verify the menu item text
text = menuItem.getText()
if( text <> "A menu item") then
Reporter.ReportEvent micFail,"Menu Item Text", "Expected text 'A menu item'. Acutal was "+text
else
Reporter.ReportEvent micPass,"Menu Item Text", "Got Expected text "+text
End if
' select the menu item
menuItem.select
'verify the text field was set correctly
text = textFieldObj.getText()
if( text <> "First Menu Item") then
Reporter.ReportEvent micFail,"TextField Text", "Expected text 'First Menu Item'. Acutal was "+text
else
Reporter.ReportEvent micPass,"TextField Text", "Got Expected text "+text
End if
' right click to get popup menu
labelObj.fireRightMouseClick
' get the popup menu
Set popupMenu = appObj.getPopup()
' get the second menu item
Set menuItem = popupMenu.getMenuItemAt( 1 )
'verify the menu item text
text = menuItem.getText()
if( text <> "Another menu item") then
Reporter.ReportEvent micFail,"Menu Item Text", "Expected text 'Another menu item'. Acutal was "+text
else
Reporter.ReportEvent micPass,"Menu Item Text", "Got Expected text "+text
End if
' select the menu item
menuItem.select
'verify the text of the tooltip
text = textFieldObj.getText()
if( text <> "Second Menu Item") then
Reporter.ReportEvent micFail,"TextField Text", "Expected text 'Second Menu Item'. Acutal was "+text
else
Reporter.ReportEvent micPass,"TextField Text", "Got Expected text "+text
End if