Forum Discussion

mbujnowski's avatar
11 years ago

Android Toast test

Is it possible to check if the correct toast occurs? Because I have no idea how to check it - comparison of two pictures doesn't solve my problem.



Regards, 

Mike
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Michal,


     

     


    In TestComplete 10.4, you can use the WaitForControlWithText method. It will wait for a toast with the specified text. Here is an example of the call:

     

    //JScript
    var AndroidProcess = // ... Obtain the process of your tested app
    AndroidProcess.WaitForControlWithText('My Toast', 1000)
    

     

  • Hi Michal,



    Perhaps a little more information if you would?



    We're testing toasts here and have found some ways to test for the existance of a toast (albeit with static toasts - I.e. ones that do not disappear in 3 seconds or whatever) with region checkpoints. 



    Toasts can never receive focus (and this is by design)



    Altus
  • Android Process- indicates the object name of the screen where toast message displayed?
  • Toast message is dynamic - Changes frequently.

     I need to capture toast message in Output(logs). 

    Is there any way that I will capture the toast message(changes frequently) displayed on the screen.