Forum Discussion
Try using Object Spy to look at the drop-down. If you look at the Advanced options, you get many more properties to use.
In my attached example, there's a value list at the very bottom that has all the drop-down choices and I drilled down to find the index. You can see the whole path to the field just above the properties.
We also use something like this to access cells in tables.
Hi Marsha,
When I try to spy on a sub menu, the whole menu gets recognized instead on the individual items on the menu (as seen in the screenshot above).
I was wondering if there could be a way where in each of the items gets recognized instead of the whole menu.
- Marsha_R10 years agoChampion Level 3
Hi Nimith -
I haven't seen menus come up in Object Spy as individual items. The index I explained above is the way we get to the individual items. In your case, index = 0 would give text = CREATE and index = 1 would give text = MOVE.
You can use the full object name (all the way down to text or another property) to select or click or whatever action you need.
- Ryan_Moran10 years agoValued Contributor
It looks like the menu is drawn separately from the menu control.
In which case something like: Sys.Process("XYZ").WinFormsObject("frmMainMDI").WinFormsObject("MdiClient", "").WinFormsObject ("frmDisplay").MainMenu.Click("MenuName|ANNOTATIONS|CREATE");
would not work.
One method to work around this might be to click the menu item first, then use text recognition or coordinates to click the text on the popup dialogue/menu. (Text Recognition)
//JScript , example only, untested Sys.Process("XYZ").WinFormsObject("frmMainMDI").WinFormsObject("MdiClient", "").WinFormsObject("frmDisplay").MainMenu.Click("YourmenuItemhere"); Sys.Process("XYZ").Window("#32768", "", 2).Click(5,50); //clicks first item in list Sys.Process("XYZ").Window("#32768", "", 1).Click(5,50); //clicks first item in list
- Ryan_Moran10 years agoValued Contributor
Also keep in mind that the index of the #32768 Window may change during run time as the windows are created when they fly out. The index given in the example may or may not work during run time. If not try reversing like so:
//JScript , example only, untested Sys.Process("XYZ").WinFormsObject("frmMainMDI").WinFormsObject("MdiClient", "").WinFormsObject("frmDisplay").MainMenu.Click("YourmenuItemhere"); Sys.Process("XYZ").Window("#32768", "", 1).Click(5,50); //first menu Sys.Process("XYZ").Window("#32768", "", 2).Click(5,50); //second menu