How to press physical menu button in android?

How can I press the physical menu button in android?

@Appium_Master @rgonalo @jonahss Could you please help in?

You can do it with key events. I think the name of the menu button is KEYCODE_MENU (82).
In java it would be like:


Type this and once you click dot you will get all options which you can use it like menu, back, home…etc

Cool !

Thank you Guys ! :smile:

i have tried all of these but none of them worked for me

((PressesKeyCode) driver).pressKeyCode(AndroidKeyCode.MENU); ((PressesKeyCode) driver).pressKeyCode(AndroidKeyCode.MENU, AndroidKeyMetastate.META_SHIFT_ON);
HashMap swipeObject = new HashMap(); swipeObject.put(“keycode”, 82);
((JavascriptExecutor ) driver).executeScript(“mobile: keyevent”, swipeObject);