Forum Discussion

googleid_102416's avatar
googleid_102416
Contributor
13 years ago

How to handle ActionScript errors displayed by Flash Player

I need to catch ActionScript errors displayed by Flash Player. The error may appear any time, so I'd like to have some kind of event to be able to handle it properly.



There is a OnUnexpectedWindow event, but it does not handle AS errors:

http://support.smartbear.com/viewarticle/28402/


  • Hi,


     


    According to the "Handling Unexpected Windows" article, TestComplete does not handle ActionScript errors displayed by Flash Player. However, sometimes, TestComplete can automatically recognize these errors and posts them to the Test Log. To learn whether you can make TestComplete handle the errors properly, could you please provide us with access to your tested app (or resend this question to our Support team if your app isn't public)?


     

  • Do you mean that TestComplete does not provide out-of-box solution for catching flash errors? This would make it completelly useless for flash app testing.



    In my test script can I at least set up an event handler for changes in flashlog.txt file, search for errors there, and handle them?



    Thanks.

  • Hi,


     


    I meant that sometimes TestComplete catches these errors as unexpected windows. It depends on the implementation of flash apps. If you provide our R&D team with your app, they would probably find a ready solution for you.


    As for monitoring the flashlog.txt file, you can create your own script that will compare the modification date of the file. Go through the "Working With Files From Scripts" article for details. 


     


  • Too bad, I wrote to SmartBear support two months ago but still haven't got any workable solution.


     


    In the "Working With Files From Scripts" article I don't see any notifications functionality. Can you explain how can I watch for a file change? Obviously reading file (or checking its date) in a loop is not an acceptable approach.


  • Hi Alexander,


     


    I see that our R&D team is working hard on resolving the issue. Post here the results you will get.


     


    As for your question, you will need to check when the file was last modified by using the aqFile.GetLastWriteTime method.


     

  • maximojo's avatar
    maximojo
    Frequent Contributor
    Yes, if someone could post a workable solution that would be great. I have similar issues with catching the action script error poup.
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hi Mark,



    Are these ActionScript errors displayed in a separate window that is identified by TestComplete Object Browser as a regular Windows window or this is internal Flash window that is not identified at all (or identified only due to the Flash support in TestComplete)?
    • Antonio_Haynes's avatar
      Antonio_Haynes
      Contributor

      Sorry, I know this is an old thread but im looking for a solution to something very similar to this .... I have added in my 
      OnActionScriptException function 
      Runner.Halt("An Action script error occured during playback of the test!");
      whenever i recieve an action script error my test stops and logs my message however the action script error dissapears off screen immediately. I need a way to keep action script errors on screen or to at least capture and log them in my test log.
      Any help would be appreciated, I can't do much with tests that can't capture Action Script errors. 

      Thanks,
      Antonio Haynes.