I have this below snippet of code in my automation framework
public void settings() {
try {
//((AndroidDriver) Driver).pressKeyCode(AndroidKeyCode.SETTINGS);
((AndroidDriver) Driver).pressKey(new KeyEvent(AndroidKey.SETTINGS));
updateTestLog(Action, "settings pressed", Status.PASS);
} catch (Exception ex) {
updateTestLog(Action, ex.getMessage(), Status.DEBUG);
Logger.getLogger(KeyActions.class.getName()).log(Level.SEVERE, null, ex);
}
}
I have connected with the mobile and see if it's working fine. In Appium server got log traces that Key code 176 (Settings) worked fine. But no action in mobile screen
I have tried it for different keys like "Menu","home","search" and "enter". I see it is executed and working fine in mobile.