Search code examples
androidrobotiumandroid-testing

Toast is not shown android robotium test


I want to test "Add new item" activity in my application. When user fills data incorrectly and then press OK button - the toast (issues list) is displayed. My question is: How can I check that toast is not shown?

Thanks!


Solution

  • Simply assign a flag variable where you handle the onClick event of your OK Button which issues the Toast. Set that flag to true,and then later check, if the flag is false, the Toast was never shown.