Forum Discussion

Ryu's avatar
Ryu
Contributor
3 years ago

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?

  • Hi,

    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

    • Ryu's avatar
      Ryu
      Contributor

      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.

      • mattb's avatar
        mattb
        Staff

        Hi,

        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.