cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
Contributor

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

Hi,

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

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

 

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

                        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 😉

 

View solution in original post

18 REPLIES 18
Highlighted
Community Hero

There are a couple of things you can try:

 

1) Record a test that opens those menus so you can make sure that you are calling the objects the same thing that TestComplete is.

 

2) Try running the test in debug mode so you can step through those menus.  It's possible that the test is running faster than the drop downs are loading so that the test looks for the second menu before it actually exists.  You can handle that with some version of Wait, maybe Wait Child.

https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-a...

Tags (1)
Contributor

@Marsha_R Thanks for your reply,

when I record a Test that's working correctly because, she creates a new mapping name for every Object in her DB, but I do not want to create one map's name for every object. I am looking for global solution.

I have use wait between these two menus, but I get some reason. I think TC cannot find second popup. Please look at photos , she cannot find Button Object.

 

 

Highlighted
Contributor

Hi to all,

nobody have no Idea!

Highlighted
Community Hero

@MadGrb just a little piece of information for you - most of us here are volunteers and working at our own jobs in many different time zones.  You might not get a quick response because there is no one available because of the time of day or because we have duties at our paid jobs.  Patience is a good thing to have here.  

 

Now, TestComplete is capable of finding your object because you've seen it in your recorded test.  Let's see screenshots of the Object Spy results for the first menu, including the Advanced view please.

Highlighted
Contributor

@Marsha_R Hi,
I want say,

when I say hey nobody has no Idea, that mean's not just to you but also I ask everyone that working (as employ or as volunteer) in this community.

 

You must pay undivided attention, that TC is not Free Software and that is absolutely expensive. Therefor when a person asking about a problem, even in community or in support department. We expect to geting fast response and correct from TC. As you know, our company invest in TC to get response about her requirement.

 

So, if you are volunteer, you must not every time answer my question, and I do not ask you too, but if you are working in TC, I ask you to get response.

 

Naturally I am understand that you have time-plan for every response.

Highlighted
Community Hero

We’ve all paid the fees for TestComplete, but some of us learn how to use the forums and support properly and aren’t demanding about it.

If you want a quick, direct response from Support, then you need to go here to contact them.

https://support.smartbear.com/message/?prod=TestComplete
Highlighted
Community Manager

Hi @MadGrb,

 

It looks like your question requires a deeper investigation. I see that you are using a WPF popup menu. To start, could you please check that TestComplete officially supports the WPF control used in your tested app? You can find a list of all supported controls in the Supported WPF Controls article.

 

Also, it's worth calling the Refresh method from the menu after you click the first item. This will make TestComplete refresh the object tree and the tool may find the needed subitem.

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Community Manager

Hi @MadGrb , could you share your progress with this issue with us? Did the advice help?


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

@TanyaGorbunova Hi,

I have use refresh but I get nothing.

 

                                Aliases.JTL_Wawi.Popup.Root.PopupMenuBarControl.RefreshMappingInfo()
                                Item = Aliases.JTL_Wawi.Popup.Root.PopupMenuBarControl

again she find old ContextMenu 😞 

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors