Forum Discussion

vlad230's avatar
vlad230
Contributor
13 years ago

Skipping Test Item when the first error occurs

Hello,



I have a test suite containing multiple test items and I would like to skip the execution of a test item when the first error occurs (not continuing to run the test item because the rest of the steps in the test will be redundant) and jump to the next test item in the suite.



I've been thinking of setting an event handler that will somehow stop the current test and jump to the next one.



I discovered that I can use:



  Project.TestItems.Current;





To refer to the current test item but I don't know how to stop it (without stopping the whole test suite) and how to jump to the next test item.



Can somebody help on this?



P.S. I'm using Test Complete 8 and I'm coding in Jscript.



Thanks,

Vlad
  • NikhilReddy's avatar
    NikhilReddy
    Occasional Contributor
    Hello Everyone,

    I am new to TestComplete. I am recording the Keyword tests instead of writing script's.

    I have similar issue as described by Serglu Vlad, I have a project suit with few projects in it & each project mostly has only one Keyword Test in it. When I run the project suit , It has to run all the projects inside it in a series, if tests encounters an error it has to log the error and skip to the next test in the next project in the project suite.



    The solutions describes above are either stop the whole project suit with out running the following project's tests.

    I tried uncheck stop on error in project's playback properties and opted the stop on error (project) also tried (Test Item) but didn't see the expected results. i.e [After the first error occurs test should stop executing the rest of the steps and skip to next test in next project without stopping the whole project suit]



    There is one more place  to check the stop on error if we right click on Project Suite and choose edit >> Test Item. I tried Stop on Error uncheck  and check both didnt take effect and only the option in stop on error in project's playback properties stood for itself.



    I want to know if there is any event handling things as discussed above by Jackson L
    and Sergiu Vlad  to do the job in the recorded Keyword tests. Its important that I don't want to write the scripts.



    I am planing to use Try - Catch or Label - Go to Label or If ... then to atlest skip to the last step of the tests if an error occurs, but that is a lot waste of time.



    Can anyone suggest the solution please.



    Thank You,

    Nikhil
  • NikhilReddy's avatar
    NikhilReddy
    Occasional Contributor
    Thank You, Ncoes Jaycon



    Your information did the Job. However if  Error message is written with in the "Stop Execution" statement then a recursive call to the OnLogError event handler is generated and craching the test. 

  • Ruhul_Ikram's avatar
    Ruhul_Ikram
    Occasional Contributor
    Hi Ncoes Jaycon and Nikhil Reddy,



    I am having the same issue as Nikhil was having for Keyword test. I tried to follow it as it said on the urls but I am no being able to impliment it.



    I am new to this Tool, I can see some people still have same issue as me. Nikhil if any chance can you share a step by step guide how you implemented. It would be a great help.



    I am using version 9.30.3373.7



    Also since it has keyword test data driven, why not Smart Bear just add something simple to impliment so we dont have to writ emanual script?



    Thanks