Jump to content

Select Item from Context menu


 Share

Recommended Posts

I am working on an automation project and I am having issues finding documentation on selecting an item from a context menu, or a menu that appears upon a right click. I tried using the Send("{DOWN}") command as a workaround but it's not very redundant. Essentially I need to search the context menu for the string "Abort Text" and click that option. The class of the context menu is showing as CLASS:#32768. I have uploaded a portion of the context menu. If it helps I have the handle of the treeview where the first item is right clicked in order to make the treeview appear.

 

 

scapa.JPG

Link to comment
Share on other sites

I am afraid that doesn't work. When I output $treeItem to a msgbox it returns 0 as in the item was not found. I tried the handle of the treeview itself and the handle of the context menu. 

Link to comment
Share on other sites

  • 5 months later...

Thanks for your post, I ended up using the following code.

 

$treeView_hnd = ControlGetHandle($title, "", $window)
$findItem = _GUICtrlTreeView_FindItem($treeView_hnd, "Scapa Test Trace - FullTest", True)
_GUICtrlTreeView_ClickItem($treeView_hnd, $findItem, "Right")
Sleep(200)
Send("{DOWN 9}")
Sleep(500)
Send("{ENTER}")
Sleep(500)
ControlClick($abort_title, "", $abort_button)

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...