Vitaliy4us Posted July 7, 2014 Posted July 7, 2014 The context menu is called by mouse right click. It contains some options. The list of the options could be different depending of application mode. There is an automation test case checking the list of the options. So the problem is how to get the text from the context menu and to analize it. Autoit window info does not recognize the text. The only things it can see are: Class: #32768 Position: 1465, 743 Size: 118, 115 Style: 0x94800000 ExStyle: 0x00000189 Handle: 0x000B054A The context menu window is accessible by its "[Class: #32768]" and its options could be selected by sending the first letter of the option to the context menu. But the text could not be recognized in any way. Is there any idea how to solve the problem?
junkew Posted July 7, 2014 Posted July 7, 2014 see example section the thread on IUIAutomation FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Vitaliy4us Posted July 8, 2014 Author Posted July 8, 2014 see example section the thread on IUIAutomation Sorry, but nothing was found concerning the problem.
Vitaliy4us Posted July 9, 2014 Author Posted July 9, 2014 (edited) There is a good working script for accessing a context menu but not in my case. It does not work and return an empty string for each context menu item. The only difference between this inaccessible context menu and another ones is that my context menu has an icon for each its item. The menu is accessible by its class, all its items could be counted. New items text could be setted, but not displayed. For example the result of the code For $i =0 To _GUICtrlMenu_GetItemCount($hMenu) - 1 _GUICtrlMenu_SetItemText($hMenu, $i, "Item" & $i) Next For $i = 0 to _GUICtrlMenu_GetItemCount($hMenu) - 1 $text = _GUICtrlMenu_GetItemText($hMenu, $i, $MF_BYPOSITION) ConsoleWrite("This is a text of the item " & $i & ": " & $text & @CRLF) Next is: "This is a text of the item0 : Item0 " "This is a text of the item0 : Item1 " ..... and so on But the text of the items shown in console is not displayed in the menu. From another hand, new items could be added and are displayed successfully. Also all menu items are accessible by there first letter (the option could be called by sending the letter to the menu). Edited July 9, 2014 by Vitaliy4us
junkew Posted July 13, 2014 Posted July 13, 2014 (edited) Did you find the iuiautomationthread? Try THE simple spy and see if textmenuitems are recognized Edited July 13, 2014 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now