I am writing uiautomator test case for running Android app program in emulator. Here comes the problem, assume I run the Ui test case in a different emulator machine. How co
Generally you use functions like UiDevice.wait(..) to pause until your test can proceed.
For example, if you have a button which opens a screen containing some elements you want to interact with, you'll need to wait for the new content to appear before trying to interact with those elements.
This would look something like:
detailsButton.click();
device.wait(Until.hasObject(By.desc("Details Pane")), TIMEOUT);
// Do something on the details pane