Ask a Question

TestComplete cannot find nested Popup menu, In neste popup menu.


TestComplete cannot find nested Popup menu, In neste popup menu.


I have massive Problem with nested popup menu.


In my case, are two popup menu but TC can find just first one and ignore second one.


Look at Photo 1.jpg and 2.jpg, 3.jpg that show us there is a Object from Class BarButtonItemLinkControl. But when I'm Looking for this object in my Code, I find she is not Exist.


Photo 4.jpg, 5.jpg.


How can solve this Problem.


@sonya_m Hi,

I have create Support-Ticket around 3 weeks ago, but I get no answer from Smartbear's Support team. 😞

SmartBear Alumni (Retired)

Hi @MadGrb ! I think I found your case about the nested Popup menu, #00442367.


The support engineer replied to you there on July 6, and looks like they are waiting for some information from you to continue investigation.


Please keep working in this case with the Support team and let us know when you have a solution🙂

Sonya Mihaljova
Community and Education Specialist

Hi @sonya_m ,

I get no mail from your coworker from Smartbear. Can you please give me Address of your website's position, that there can I fallow my Ticket.

SmartBear Alumni (Retired)

@MadGrb Here's the answer I see from Support in your case:


Quite a lot of menus of this type are supported in TestComplete in a special way and you can just record a test over them that would look something like menuObj.Click("parentItem|childitem"). You can try creating a new clear project and recording an item selection in this menu once. If you do not see that it is recorded as something like I mentioned, then the menu is probably not supported, and we need to work with individual popups.

As for navigating these menus manually, it seems that you have created this test by hand instead of recording it. Please let me know if the test that you recorded as I mentioned above can be replayed. If not, please export and share one log that demonstrates the issue. Even better - share this new project completely along with one log inside. This way, I will have more information on why it might not work. You can upload any files using the link at the bottom of my reply.



Also, our engineer replied to you in the new case you opened today. Did you receive this email?


You can check your submitted questions in the Case Management Portal. The confirmation email with the submitted case number you received should contain this link.


Sonya Mihaljova
Community and Education Specialist

@sonya_m HI,

many thanks for your replay!


Unfortunatly, nothing is in my inbox 😞

SmartBear Alumni (Retired)

@MadGrb I just sent you a private message in the Community. Please check.

Sonya Mihaljova
Community and Education Specialist

Finally I write a script to Click on nested Menu that is not recognized with TC-Engine.


        def SelectContextMenueStrip(cls, Contain_0 = '', Contain_1 = ''):
                        Index_0 = 0
                        Index_1 = 0

                        ContextMenuStrip = Aliases.JTL_Wawi.ContextMenuStrip
                        Height = ContextMenuStrip.Height
                        Width = ContextMenuStrip.Width
                        Count = ContextMenuStrip.get_Items().Count
                        IndividualHeight = Height / Count
                        for Index_0 in range(0,Count,1):
                                Item = ContextMenuStrip.GetItemAt(Width/2, IndividualHeight * Index_0 )
                                if Item != None:
                                        if ContextMenuStrip.GetItemAt(Width/2, IndividualHeight * Index_0 ).Text.OleValue == Contain_0:
                                                ContextMenuStrip.Click(Width/2, IndividualHeight * Index_0) 
                                                if Contain_1 != '':
                                                        ContextMenuStrip_1 = Aliases.JTL_Wawi.ContextMenuStrip.activeDropDowns_2.Item[0]
                                                        Height_1 = ContextMenuStrip_1.Height
                                                        Width_1 = ContextMenuStrip_1.Width
                                                        Count_1 = ContextMenuStrip_1.get_Items().Count
                                                        IndividualHeight_1 = Height_1 / Count_1  
                                                        for Index_1 in range(0,Count_1,1):
                                                                Item_1 = ContextMenuStrip_1.GetItemAt(Width_1/2, IndividualHeight_1 * Index_1 )
                                                                if Item_1 != None:
                                                                        if ContextMenuStrip_1.GetItemAt(Width_1/2, IndividualHeight_1 * Index_1 ).Text.OleValue == Contain_1:
                                                                                MouseX = ContextMenuStrip_1.Left
                                                                                MouseY = ContextMenuStrip_1.Top
                                                                                Sys.Desktop.MouseDown(VK_LBUTTON , MouseX + Width_1/2, MouseY + IndividualHeight_1 * Index_1)
                                                                                Sys.Desktop.MouseUp(VK_LBUTTON , MouseX + Width_1/2, MouseY + IndividualHeight_1 * Index_1)
                                                        Index_1 += 1
                                Index_0 += 1
                except Exception as exp:
                        Log.Message('SelectContextMenueStrip - type:' + str(exp)) 



I use mouse position to click on desktop, Enjoy it 😉


SmartBear Alumni (Retired)

Thank you for following up on this @MadGrb I am really happy to see this finally solved😊

Sonya Mihaljova
Community and Education Specialist

Occasional Contributor

I also had problems identifying sub menus on a popup menu in my case. it is a WPF app.

I have two levels of menu which are fixed and the third which is dynamic and I wanted to select by the name of in the 3rd level, not the index.

I have found a solution that I worked out with a suggestion from another Forum member and I wonder if it will help you too.

Sub ClickPopup(Category,ItemName )
  Dim MyDiagram
  Set MyDiagram= Aliases.ClientHost.HwndSource_ProcessEditor.ProcessEditor.tabControl.myDiagram
  Call MyDiagram.ClickR(223, 369) ' Will make this a parameter eventually
  Call MyDiagram.PopupMenu.Click("New|" + Category) 'Category is the second menu level which I want to select
  Dim FoundEntry
  Set FoundEntry = NameMapping.Sys.ClientHost.FindChild("text",ItemName,100) ' ClientHost is the application main window

End Sub


Sorry, if this is not what you need.

Showing results for 
Search instead for 
Did you mean: