Skip to content Skip to sidebar Skip to footer

How To Select A Sub Menu From A Context Menu?

I am trying to click on a sub menu(BTDecoder) item from a context menu(send to) using pywinauto. I could click on the menu item from context list and click on it. But when i try to

Solution 1:

you should be using backend ='uia' and below is the code you need to use to click on context menu's submenu item

popup_menu = Desktop(backend='uia').window(title="Context")
popup_menu[submenu].click_input()

Solution 2:

path=os.path.realpath(path) 
os.startfile(path) # open the folder named "FW"
app = pywinauto.Desktop(backend='uia').window(best_match='FW')
win = app.window(title_re='WRT_FW_27_12_2018_11_19_59_000001')
win.click_input(button='left')
win.click_input(button='right') # right click on one file listed there
app1 = pywinauto.Desktop(backend='uia').window(best_match='ContextMenu',top_level_only = True)
win1 = app1.window(title_re="Send to")
win1.click_input()

Add the below lines

app2 = Desktop(backend='win32')
app2.PopupMenu.menu_item('BTDecoder').click_input()

Post a Comment for "How To Select A Sub Menu From A Context Menu?"