I\'m starting an already installed app using appium.
After my driver is initialized. How do I make it poll-wait till certain activity is displayed?
I saw onl
You can use the following code to poll the current activity every second. If you want to reduce polling time you can reduce sleep time to 500 and wait*2
:
public void waitForActivity(String desiredActivity, int wait) throws InterruptedException
{
int counter = 0;
do {
Thread.sleep(1000);
counter++;
} while(driver.currentActivity().contains(desiredActivity) && (counter<=wait));
log("Activity appeared :" + driver.currentActivity(), true);
}