Contributions
Re: TestComplete cannot find nested Popup menu, In neste popup menu.
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 FoundEntry.Click() End Sub Sorry, if this is not what you need.2.9KViews1like0CommentsRe: Dynamic Object Recognition and how to use FindChild in Keyword test
Hey - I have found a solution that I worked out with a suggestion from another Forum member. 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) Dim FoundEntry Set FoundEntry = NameMapping.Sys.ClientHost.FindChild("text",ItemName,100) ' ClientHost is the application main window FoundEntry.Click() End Sub Thanks for the hints and help from rushikesh.3.5KViews1like1CommentRe: Dynamic Object Recognition and how to use FindChild in Keyword test
Ok, Thanks for your help so far. As I said - I am trying to avoid using script but I have decided to try this anyway. Let me explain the problem I have now. I have a three level menu. The first and second levels are fixed in structure, the third is not so sometimes what is now item 2 may be item 1 next time. So I have tried to implement the findchild but with no success. On the second CLick() I get "Object does not exist". Please can you indicate what I am doing wrong. Sub ClickPopup(ItemName,Category ) Dim menuEntry set menuEntry = NameMapping.Sys.ClientHost.HwndSource_ProcessEditor.ProcessEditor.tabControl.myDiagram set FoundEntry = menuEntry.PopupMenu FoundEntry.Click("New|" + Category) set FoundEntry = NameMapping.Sys.ClientHost.HwndSource_PopupRoot.PopupRoot.FindChild("WPFControlText", ItemName,4,0) FoundEntry.Click() end sub I know the code is messy and uncommented but at this stage I am just trying things out as quickyly as possible. Thanks.3.5KViews0likes2CommentsRe: Dynamic Object Recognition and how to use FindChild in Keyword test
Ok, I have stated that my boss does not want user code.I understand your frustration that I don't just do it with a bit of script but I AM NOT PERMITTED TO and, believe me, I have argued my point frequently. so what have I tried? I have found that I can get a child item within a Keyword test into a variable of type object. (Can't prove this works yet due to the point below.) How do I then click on the object which is now in the variable? Note that I really want to find the object with the text "New" somewhere within the popup menu which appears after the ClickR on bpa Diagram but, by the time I get back to TestComplete the menu is gone. If I do a recording it does say Popup menu is the Item/Object but this is not in the name mapper as far as I can see. I have attached a screenshot of how far I have got but what do I select as the new operation in the keyword test in order to get a click? I have tried On-Screen Action but if I select the variable for it to act upon (which contains the object from the previous Set variable step) it then says that this has no operations. Screenshot of the test attached. I did also try to create a new mapping and, somehow, I go a tree down to the first level of menu. however, my menu could be multiple levels (3 currently) and I would like to find the child with a certain name at any point in the tree. SO I suppose I would use FindChild on the root level of the menu. Also attached a picture of this. Thanks to anyone who can help.3.5KViews1like4CommentsDynamic Object Recognition and how to use FindChild in Keyword test
Hello, everybody. I am currently assessing TestComplete as a replacement for another Automated test tool which is becoming more and more cumbersome. I have only a short time to complete my assessment before I have to return to "real" work and will have no opportunity to continue. Please excuse me if I am missing the obvious as I am trying to rush things through a bit, sorry. My boss will not allow us to use User Code as she feels this makes our tests difficult to maintain. Most of our testers have no programming background. Consequently, I am trying to use Keyword Testing as much as possible. I have two problems, which I believe to be interrelated. 1. We have dynamically generated popup menus. In the other tool, we could supply a variable against one of the properties (text) to find the menu item we wanted to click. In my current keyword tests, I find an apparently fixed index number. I have read this articleTesting-with-a-dynamic-built-menu-structurewhich indicates the use of the FindChild method may solve my issue but I would like a (pictorial?) example of how this would look in TestComplete. Step by step would be great. I have attached a screenshot of the menu I want to be dynamic. 2. In a similar vein, we often have a number of objects which are dynamically placed on screen, and, in the other tool we can, again, reference these using a property such as caption which is linked to a variable at run time. I have tried using a variable against a property for these objects but at runtime, the value of the variable seems to be ignored and I get the object which was originally recorded. I wonder if FindChild will also solve this problem. I have attached a screen shot of what I tried but even when I change the variable StepNumber1 the object selected is the same. Many thanks in advance. Regards to all.Solved3.6KViews0likes6Comments