Forum Discussion

poyo_munandar_p's avatar
poyo_munandar_p
New Contributor
11 years ago

Fast fail in TestExecute

Hi, we want to implement fast fail using testexecute and we can not do it in our application -the one that use TestExecute-. So we need the fast fail is implemented in the TestExecute itself. is there any parameter or something that we can do to implement this fast fail?



Fast fail means if one of the testcase failed then just stop to execute the next testcase and do cleanup and generate report as usual.



Also is there any options to set the TestExcute to generate the report everytime automatically after each testcase finished or for this purpose we just need to play in the *.pjs file?
  • Hi Poyo,

    I'm not aware of any options to implement a fast fail in TestExecute.  On the other hand programming such a feature should not be difficult.



    • Create a project variable like errorFound and set to false.


    • In the event OnLogEvent set errorFound to true


    • In your code check in an approriate location if errorFound is true and then call Runner.Stop


    Have a look at the methods for the Log Object.  You should be able to find something to generate a report everytime a test case finshes.  However I'm not sure where to put the code (maybe in the OnStopTest event).  You may have to find an appropriate place in your code to do this.

  • Building on Adrian's answer, you could do the following for long duration stress type testing



    - Disable "Stop on Error"

    - Add the global errorBool variable that Adrian mentioned

    - Add an errorCount integer variable

    - Build a loop to run inside of your test item (e.g. 1 test item will run 100 iterations of test)

    - Throw errors where required

    - Bubble the errors to the top level loop

    - Set the errorBool variable in the OnLogError event handler

    - Increment the error count

    - Determine how to handle the error in the loop

    - Reset error condition after error has been handled



    We do something very similar with out long duration testing, and it works like a charm.  Until, that is, TE stops responding and we are forced to restart the test.