Click back button twice in Android 7 using appium (uiautomator2)


I’m using appium (uiautomator2) to automate instrumentation tests on android (os version 7).
Everything works fine except when try to do driver.back() twice. The first driver.back() works but the second driver.back() doesn’t. It does not throw any error but just proceeds. I’m guessing either the appium server or the uiautomator2 is assuming the second command to be a duplicate and ignoring it.

Have any of you faced such an issue ? Any thoughts ?

What language client are you using?

Make sure you are on the proper view before pressing back again.