Forum Discussion
The recorded action converted to the following steps:
Aliases.CrewWare.HwndSource_PopupRoot.PopupRoot.Click(58, 105)
Aliases.CrewWare.HwndSource_PopupRoot.PopupRoot.Click(68, 11)
Aliases.CrewWare.HwndSource_PopupRoot.PopupRoot.Click(64, 15)
The image snapshots for each step above showed the correct submenu, but when run, all of the clicks occured in the first-level menu, not the submenus. Additionally, these are still based on relative X,Y coordinates of the object. I would like to access the menu items by name, header, or possibly even a tag in the WPF object.
The TC Click Action accepts X,Y coordinates, so name or index will not work as parameters there.
Others report success using FindChild, but I have not been able to get FindChild to return the menu item object.
The object returned by Point and Fix object:
Aliases.CrewWare.HwndSource_PopupRoot.PopupRoot.WPFObject("Decorator", "", 1).WPFObject("NonLogicalAdornerDecorator", "", 1)
I'm thinking I need to poke around this object somehow.
Poking around the Aliases.CrewWare.HwndSource_PopupRoot.PopupRoot.WPFObject("Decorator", "", 1).WPFObject("NonLogicalAdornerDecorator", "", 1) object has been enlightening, but I cannot figure out how to access the menu items by name. I know this has been solved because I see other solutions. Can someone help me understand what I'm working with?
While poking around, I did write the following snippet and received the following results. Am I barking up the right tree or pursuing a futile course of action? Can someone explain what these object are?
Script:
# Attempting to figure out how to access context menu items by names, so far unsuccessful
arrayproperties=["ClrClassName"]
arrayvalues=["*"]
something = Aliases.CrewWare.HwndSource_PopupRoot.PopupRoot.FindAll(arrayproperties, arrayvalues, 100, True)
for x in range(len(something)):
Log.Message("something[" + str(x) + "]" + something[x].ClrClassName + ", " + something[x].Name)
somethingelse = something[x].FindAll(arrayproperties, arrayvalues, 100, True)
for y in range(len(somethingelse)):
Log.Message("somethingelse[" + str(y) + "]" + somethingelse[y].ClrClassName + ", " + somethingelse[y].Name)
Output:
something[0]PopupRoot, WPFObject("PopupRoot", "", 1)
somethingelse[0]PopupRoot, WPFObject("PopupRoot", "", 1)
somethingelse[1]Decorator, WPFObject("Decorator", "", 1)
somethingelse[2]NonLogicalAdornerDecorator, WPFObject("NonLogicalAdornerDecorator", "", 1)
somethingelse[3]AdornerLayer, WPFObject("AdornerLayer", "", 2)
somethingelse[4]AdornerLayer, WPFObject("AdornerLayer", "", 1)
something[1]Decorator, WPFObject("Decorator", "", 1)
somethingelse[0]Decorator, WPFObject("Decorator", "", 1)
somethingelse[1]NonLogicalAdornerDecorator, WPFObject("NonLogicalAdornerDecorator", "", 1)
somethingelse[2]AdornerLayer, WPFObject("AdornerLayer", "", 2)
somethingelse[3]AdornerLayer, WPFObject("AdornerLayer", "", 1)
something[2]NonLogicalAdornerDecorator, WPFObject("NonLogicalAdornerDecorator", "", 1)
somethingelse[0]NonLogicalAdornerDecorator, WPFObject("NonLogicalAdornerDecorator", "", 1)
somethingelse[1]AdornerLayer, WPFObject("AdornerLayer", "", 2)
somethingelse[2]AdornerLayer, WPFObject("AdornerLayer", "", 1)
something[3]AdornerLayer, WPFObject("AdornerLayer", "", 2)
somethingelse[0]AdornerLayer, WPFObject("AdornerLayer", "", 2)
something[4]AdornerLayer, WPFObject("AdornerLayer", "", 1)
somethingelse[0]AdornerLayer, WPFObject("AdornerLayer", "", 1)
- RandyJ51507 years agoOccasional Contributor
No solution found on how to access context menu items by Name or by Header name.
- brohrbacher6 years agoOccasional Contributor
Did you ever get the items in the Context menu to work based on their names? Having the same issue right now.
- RandyJ51506 years agoOccasional Contributor
I haven't revisted the project in a very long time. I will go back and review where we left-off. I don't think we ever found a fool-proof solution, but I'll let you know where we ended-up.
Related Content
- 11 years ago
- 4 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 7 days ago