Menu and submenu mapped as same object; TC does not see submenu on a run
When I recorded a script, TC mapped the "File" menu for my application as TTBPopUpWindow. I needed to access a sub-menu from the File menu, which TC also mapped as TTBPopUpWindow. Because of this, during the run, TC only sees the first menu, and when the sub-menu pops up, it doesn't see it at all. I'm not sure how to make these two separate mapped objects. I have seen another similar problem where the OP was told to use NameMapping's "Conditional mode", however, I cannot find this feature either in TC or in the TC support documentation. Another way I might be able to get around this is to use OCR to find the text I want to click on, however it is still expecting the first TTBPopUpWindow object here, as well - is there a way to have OCR look at the whole screen instead of a single object?
OCR Will look at the text of an onscreen object. What object you select is up to you. You could have OCR across the page level or at a parent object level too.
OCR does require the text to be displayed on screen. So as long as the text is visible, OCR should be a good work around while we figure out the issue with the menu
OCR is also not seeing the text, even when looking at the entire application window. The text is visible to the user, too, so I don't know why OCR doesn't "see" it.
Does the submenu disappear when not hovering over it? Or when clicking off of it?
We don't necessarily have to use OCR yet either. I would try to enable the top asterisk in the MSAA settings here: https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/open-apps/...
Then restart the application under test and see if you can spy the object.
If that doesn't work, I would try combinations of UIA, MSAA and text regonition: https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/open-apps/... Enable an asterisk under the extended support tab. You will have to click add to add a field for the asterisk and enable it.
I would try combinations of 2 of UIA, MSAA, and Text Rec, combinations of 3 can cause overlap. If these settings do not work I would also recommend turning them off as they do expose more properties, it will probably be unnecessary and cause slowdowns.
By using these enhancements, it should provide more properties for TestComplete to map the sub menu, therefore more robust object recognition.
@mattb it does not disappear when removing focus unless either there is a mouse click elsewhere or the mouse hover moves to another menu. I can "spy" the submenu with Object Spy, but it OS says that it is still application.TTBPopUpWindow, which is the same mapping of the main File menu. During recording and name mapping, it always maps those two menu trees the same way. During run, TC only sees the main File Menu, even after opening the submenu. I assume the disconnect is happening because TC is seeing two of the same object and therefore is only looking at the first one it encounters. I'll try the other suggestion you made and get back to you.