Generally, we would create a new instance of the appium driver like driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities); , but I have to put a delay since it requires the apk to be installed and launched on the device before the driver gets completely initialized. Is there a way to determine programatically if the appium driver has finished initialising?
The AndroidDriver constructor blocks your calling thread until the APK is installed and launched on your device. Note that Appium does not wait for your application to reach an idle state like in an Espresso test. If you need to wait for certain UI elements to be populated on your screen, you should use a WebDriverWait, ideally.