Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
14 years ago

restart suite in script

My application under test has a bug in it. Basically when an auto timed event collides with a user event, the system crashes. There is no fire to fix this since the programmer can't find the issue and this next to never happens in the real world. It happens in our automated tests from time to time.



So my automated test scripts sees an unexpected window. I can respond to the event obviously. But I wonder is it possible to eat the error and restart the project suite IN the unexpected window handler?



Any thoughts?



Thanks


  • Hi Lane,



    There is no a built-in way to restart the entire project suite from a test. However, I can suggest you running your test from a batch file like the following one:

    @echo off



    :StartTest


    "c:\Program Files\Automated QA\TestComplete 8\Bin\TestComplete.exe" "c:\Users\Public\Documents\TestComplete 8 Samples\Open Applications\C#\TCProject\Orders.pjs" /run /exit



    IF EXIST "C:\restartTC.flag" (


      DEL "C:\restartTC.flag"


      ECHO "Restarting TestComplete test"


      GOTO StartTest


    )


    If you need to restart the entire test execution, create an empty C:\restartTC.flag file and stop the current execution. The batch file checks whether the C:\restartTC.flag file exists and if does, starts the test again. You can use the aqFile object to work with files in a TestComplete test. Please find documentation on this object in the aqFile Object help topic.