Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Espresso: returning to application

I have test in Espresso, at the end of the test I press call button in application, which leads to dialing screen of the phone.

How can I return back to application? I want to return to application to log out from it.

pressBack(); doesn't do anything.

Suggestions would be appreciated.

like image 719
president Avatar asked Jul 01 '26 08:07

president


1 Answers

 UiDevice mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
mDevice.pressRecentApps();
mDevice.pressRecentApps();

I've used UIAutomator in the end. Exactly what I need.

like image 195
president Avatar answered Jul 03 '26 20:07

president