Forum Discussion
AlexanderM
14 years agoStaff
Hello,
1. If you need just to invoke actions assigned to menu items, you can access the corresponding items using the VCLObject native method and call their native Click method.
Please note that TestComplete calls native methods of tested application objects synchronously. It means that if an object's native method shows a modal dialog, TestComplete won't be able to continue executing the test until the dialog is closed. A solution is to call the object's native methods asynchronously using the Runner.SetObjectPropertyAsync method:
Please find more information on this in the Calling Methods Asynchronously help topic.
2. Could you please tell me the reason why you need to work with menu items by their names rather than captions? I assume that you are testing the application with multilingual support, so the captions are different for different localizations, right? If so, probably, I could suggest a better solution for you.
1. If you need just to invoke actions assigned to menu items, you can access the corresponding items using the VCLObject native method and call their native Click method.
Please note that TestComplete calls native methods of tested application objects synchronously. It means that if an object's native method shows a modal dialog, TestComplete won't be able to continue executing the test until the dialog is closed. A solution is to call the object's native methods asynchronously using the Runner.SetObjectPropertyAsync method:
Runner.CallObjectMethodAsync( mainForm.VCLObject("File_Open"), "Click");
Please find more information on this in the Calling Methods Asynchronously help topic.
2. Could you please tell me the reason why you need to work with menu items by their names rather than captions? I assume that you are testing the application with multilingual support, so the captions are different for different localizations, right? If so, probably, I could suggest a better solution for you.