Forum Discussion

MSiddiqui's avatar
Occasional Contributor
8 years ago

Value dispose cannot be called while doing creaHandle()

Hi All,
I am running recorded script when my script reach to a form where we preview the report, once script click the Preview button
on the form I am getting this message "Value dispose cannot be called while doing creaHandle()" Please suugest me how to deal it.


  • Colin_McCrae's avatar
    8 years ago

    Or it may just be a bug in the application you're testing. Plain and simple.


    It's possible.


    Remember, the point of testing anything is to expose flaws. That's what testing is.


    So when automated testing, your automated tests, ideally, should cope if the application starts failing and throwing errors at you.


    Which yours is.


    There's nothing wrong with TestComplete here.


    The problem is either the application or your script. Or possibly a combination of the two.


    But ideally, your script/test structure/framework should cope with this. Automated tests can run for hours. Mine do. Not much use if an application failure stops it in it's tracks 5 minutes in! If the application fails in mine, there is a failure routine it drops into which checks a series of things, types of crashes that can happen etc, and then tidies everything up, restarts things, logs all the appropriate info, and carries on.


    If it just gave up and stopped, no-one would ever use my automated tests!

9 Replies

  • What throws the error? Your application, or TestComplete. That's a pretty important detail!


    Googling the error message suggests it may be a timing/sync issue.


    In your test, try putting a hard coded delay of a few seconds before you click the preview button. The stuff I found in the google results suggest either a timing issue (most likely in this scenario) or the code that is doing this in your application is fundamentally broken as it's invoking close methods incorrectly (less likely as you don't mention it happening manually).


    Hard coded delays are not great as they are not reliable. Searching for something within the application that indicates it's actually ready to preview would be a far better long term solution.

    • MSiddiqui's avatar
      Occasional Contributor

      Acutally, It's testcomplete issue as I can able to preview the Report from form button on my application, but once I try through Script getting this message.

      • Colin_McCrae's avatar
        Community Hero

        You didn't answer the question!


        Yes. The error occurs when you do try and replicate the process using TestComplete.


        But which application throws the error. The application under test, or TestComplete?


        ie. Which one of the two is the error window attached to.


        As I said. This is a pretty important detail!