Forum Discussion

lsainsbury's avatar
lsainsbury
Contributor
11 years ago

Differentiating between sub menus

Hey,



I'm currently trying to make a series of tests that all involve using the main menu and sub menus, however some of the menus have multiple tiers of sub menu and I have discovered their object names are all the same.



When I run a test that goes through Main Menu > Sub Menu > Sub Menu, the test thinks the position of the second sub menu is still the first sub menu so the test completes however the cursor is being placed in the incorrect postion.



Is there any way to get TestComplete to recognise my sub menus as different objects?
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)


    Hi Lee,


     


    Is it possible that the issue occurs because TestComplete is moving the cursor of the mouse during the test execution? As a result, another menu item window can be opened, and TestComplete clicks a wrong item. If this is the case, you need to set the Playback | Mouse movement delay project option to 0.


     




  • Thanks for the reply Tanya.



    I have tried setting the mouse movement delay to 0, but unfortunately it didn't help.



    On the other hand I may know what is causing the issue, however I don't know how to resolve it.



    It seems we are using some third party software for our menus so all of our sub menus are recognised as "TdxBarSubMenuControl", and missing the debug information which is only simulating mouse clicks because of that. When I enter a sub menu from another sub menu I think the script is getting confused as to where the click is supposed to be simulated.



    Edit:



    I have tried adding the TdxBarSubMenuControl to the text recognition which gets rid of the missing debug information warning but it still won't simulate a click in a sub sub menu, telling me the object does not exist even though the sub sub menu is visible on screen
  • (Sorry I couldn't edit my post again)



    It's very weird, because it recognises the first item in my sub menu "Aliases.impact.TdxBarSubMenuControl.Distance" but doesn't then recognise my sub sub menu "Aliases.impact.TdxBarSubMenuControl.Parallel"



    Edit:



    This is the script converted from the Wizard, as you can see it is very simple




    Sub MenuTest()


      'Clicks at point (14, 9) of the 'Enquire' object.


      Call Aliases.impact.ImpactMainForm.TdxDockControl2.TdxBarControl.Enquire.Click(14, 9)


      'Clicks at point (22, 10) of the 'Distance' object.


      Call Aliases.impact.TdxBarSubMenuControl.Distance.Click(22, 10)


      'Clicks at point (17, 7) of the 'Parallel' object.


      Call Aliases.impact.TdxBarSubMenuControl.Parallel.Click(17, 7)


    End Sub

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Lee,

     


    Juding by the "Developer Express BarDockControl Support" article, TestComplete officially supports the control you use. Please make sure that your application is compiled with the debug information so that TestComplete could properly recognize the objects inside it. Also, please make sure that all requirements listed in the article are met.


     

  • HiTanya,



    After reading the article everything is set up the way it is supposed to be. I don't see how our application is built without debug information, since the rest of the application works just fine with test complete.



    Infact the main menu and its sub menus work fine too, its only a sub menu within another sub menu that is not recognised, which states that the object is not visible.



    I'm running out of ideas, and its a deal breaker since our Softwares functionality is huge and I can't assign hotkeys to every single function, its just not viable.
  • Did you try putting delays between the clicks?  Sometimes things take a moment to render and become clickable.