Forum Discussion

VReplogle's avatar
VReplogle
Occasional Contributor
16 years ago

An always run capability

Hello,

Perhaps the functionality doesn't exist, but is there a way to have a 'cleanup-type step' that always gets run in any particular test case even if a previous step fails for whatever reason?

example:
test case x
  step 1 - create a record
  step 2 - pass the generated key to step 3 && 4
  step 3 - validation that shouldn't fail (but currently does)
  step 4 - delete the record
test case y (that expects test case x to have cleaned up after itself)
...

Notably, one solution seems that we could 'pull out' whatever should always happen into an extra test case (in-between test case x && y) but that would effectively nearly double our number of test cases and be less readable in the end.

Is there another SOAP U.I. alternative that could always run step 4 for x regardless of soap faults and other means of failure?  If not, should I log that as a feature?

Thank you;
  --V

2 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    hmm.. in your case maybe you could just turn off the "Abort on Error" option in the TestCase Options dialog which will keep your TestCase running even after your third step fails?

    Alternatively if you are using 2.5, you could disable the fourth TestStep and then run it from the TearDown script with

    testRunner.runTestStep( testRunner.testCase.testSteps[".."], true, true )

    which will run and log the named teststep..

    hope this helps!

    regards,

    /Ole
    eviware.com
  • VReplogle's avatar
    VReplogle
    Occasional Contributor
    Thank you, /Ole;

    Changing the "Abort on error" flag was successful at accomplishing what we wanted.  Thanks for the tip!