Hi All,
How to open app from Recently open apps in android device using Appium ?
Scenario :
I am testing app where I have to interact with OTP from SMS during testing so I am looking for solution like how can I switch back to my app after read OTP.
Steps :
- Open My app
- Enter Mobile Number
- Open SMS , Read OTP
- Again Open my app from recently open apps and enter OTP
Any help would be appreciated.
Regards,
Rahul Bhatt
You can start your app activity:
((AndroidDriver) driver).startActivity(new Activity(ANDROID_PACKAGE, ANDROID_STARTACTIVITY));
Thanks
But startActivity doesn’t work for android driver.
should i import new dependency for startActivity and new Activity ?
startActivity only works for AndroidDriver. Can you share your code and make sure the import for AndroidDriver and Activity is:
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.Activity;