Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recent Apps on UiAutomator

I am now working with Android UiAutomator on for UI Test on my Android app. My app has a function that requires the user to verify the email to continue, so I try to do it like this: after reach to that function -> getUiDevice.pressHome -> Browser -> try to log in email -> PressHome again -> Press RecentApps then I stuck here, I cannot press on my Apps to return to it again. I try another way by clicking on my App icon but it starts my app again, not at the state before. Can anyone suggest me a solution for this? Any help is appreciate.

Thanks in advance.

like image 231
DucTran Avatar asked Feb 17 '23 14:02

DucTran


1 Answers

Try this :

UiObject appBackground = new UiObject(new UiSelector().description("ABC"));
appBackground.click();

It did not show any description through 'uiautomatorviewer' command but this worked for me.

like image 95
Smriti Avatar answered Feb 28 '23 00:02

Smriti