Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I press back button using selenium web driver of android emulator

Can I press back button of android emulator using selenium web driver?

Looking for help.

like image 984
Deepak Goel Avatar asked Sep 10 '12 06:09

Deepak Goel


2 Answers

I was using Selenium with Appium and Android emulator, succeeded with

webdriver.navigate().back();
like image 197
ludenus Avatar answered Oct 10 '22 05:10

ludenus


Run the below command from my java class. It helps me to press back button.

         Runtime.getRuntime().exec("cmd /K cd " +"../libs/android-sdk-windows/platform-tools");
         Runtime.getRuntime().exec("cmd /C adb shell input keyevent 4");

Hope it will help others

like image 42
Deepak Goel Avatar answered Oct 10 '22 04:10

Deepak Goel