Press Android Back button with appium in -no-window mode

245 Views Asked by At

I'm starting the android emulator with emulator.exe -no-window and trying to send the appium command driver.PressKeyCode(AndroidKeyCode.Back). Unfortunately nothing happens. I assume the emulator doesn't support the back button in headless mode. If I start the emulator without -no-window then the back button works.

Is there a way to work around this? Running the emulator with UI doesn't seem like a good idea on a CI build.

1

There are 1 best solutions below

0
On BEST ANSWER

The back button is available in headless mode. The issue itself was a timing problem - the button was clicked too early and therefore had no effect.