Forum Discussion

mikaere's avatar
14 years ago

How do I programatically restart a test item ?

We have a parent test item that contains all of the items.  It does not work itself, and merely acts as a container.



If we get an exception in one of the tests, this could be caused by some random error, and we would like to be able to close the application, restore the database and then restart the parent test item.



Is this possible ?  We are using TestComplete 7.52.678.7 and our scripting language is VB Script.



TIA

  • Hi Mike,





    You can't change test items execution order during test run, however, the functionality you need can be achieved via scripting. For example:







    var testNeeded = false;

    do

    {

      try

      {

        test1();

      }

      catch(e)

      {

        testNeeded = true;

        restoreApp();

        continue;

      }

      try

      {

        test2();

      }

      catch(e)

      {

        testNeeded = true;

        restoreApp();

        continue;

      }

      ...

    }

    while (testNeeded)