Forum Discussion

Dalimonster's avatar
Dalimonster
Occasional Contributor
15 years ago

Teardown script is not running at all


I have been trying to figure out how to get my teardown script to run at all.
I was writing a teardown script that would execute a testcase in the testsuite. When this didn't work I just added a log.info line to the teardown script. When I execute the project, I don't see the line that I'm printing to the log anywhere in the log. The teardown test case is also not being executed.

Can someone please help me?

This my original code:

import com.eviware.soapui.SoapUI;
import com.eviware.soapui.model.testsuite.*;
import com.varolii.DataObjects.*;
import java.util.regex.*
import com.eviware.soapui.support.types.*;

def testCase = testSuite.testCases["Tear Down Script"]

def properties = new com.eviware.soapui.support.types.StringToObjectMap()
def async = false
log.info("Inside Teardown script");

testCase.run(  properties, async )


I changed the last line to:
testRunner.testSuite.testCases["Tear Down Script"].run(testRunner, context);

and it still doesn't run.

Can someone please help me with this problem?

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    I can't see anything directly wrong in what you are doing, it should work... Would it be possible for you to send us your project file so we can try to reproduce the problem? Either attach it here or mail it to support@eviware.com

    Regards,
    Dain
    eviware.com
  • Dalimonster's avatar
    Dalimonster
    Occasional Contributor
    I am unable to send you my project file because that would mean sending you our Soap API, which is proprietary.

    Is there anything else I can do to show you the problem?
    DO you have a sample wsdl file I could perhaps create a project with and try to reproduce the problem?
  • Dalimonster's avatar
    Dalimonster
    Occasional Contributor
    Also, I don't think I mentioned before that the Tear Down Script is at the Test Suite level.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    I've created a simple project which contains only a TestSuite with one TestCase, each having a setup and tearDown script that writes to the log.. When running the TestSuite I get all the correct output in the log.. can you try this?

    (I'm using 3.0.1)

    regards!

    /Ole
    eviware.com