in our app we are using Toast.makeText(context, context.getString(R.string.contact_not_present), Toast.LENGTH_SHORT).show();
to show toast message
For Ui Automation we are using https://developer.android.com/training/testing/ui-automator
While automating a use case which should fire a Toast message ,As expected the toast message was fired but i am unable to find it
I am trying to locate the element by
UiObject2 object = device.wait(Until.findObject(By.clazz("android.widget.Toast")), 9000);
But i am always getting the object as null
can anyone help me on this ?