Search code examples
androidfunctional-testing

How to test for the appearance of a Toast message


Would anyone know how to test for the appearance of a Toast message on an Activity?

I'm using code similar to what the OP posted on this question for testing my program flow from one activity to the next. I'd also like to be able to test for toast messages on particular activities.


Solution

  • Would anyone know how to test for the appearance of a Toast message on an Activity?

    You can't -- sorry. By which, I mean there is no way to ask Android "hey, is a Toast showing? and what does it look like?".