Unable to get Toast Message in Appium using UiAutomator2 on Headless Emulator?

So I am testing my application and I can get the toast message and apply assertion on it pretty easily but, as soon as I run the test on a headless emulator I am unable to get the toast message hence the test is failing.

Stack Trace

SEVERE: TimeoutException: Elements not visible: Expected condition failed: waiting for visibility of Located by By.chained({AppiumBy.id: com.bps.bpass.mainpackage:id/toastMsg}) (tried for 30 second(s) with 500 milliseconds interval)

I am actively available to answer further questions and provide more information on the question.

As far as I remember, toasts never worked on the headless emulators, as it requires a windowing system.

1 Like

@pwicherski thanks for the update, guess I am out of luck for now then.

1 Like