Forum Discussion

vikititor's avatar
vikititor
Contributor
3 years ago
Solved

start test case form event

I want to do some DEBUG of the DB state.. so after each TestCase I NEED dump data of one DB table.. This is done in some test case and the response in XML is stupidly dump in to log.info..

So I have some test case "dump_DB_data" in test suite "Reusable"..

How to run full test case? 

I just found a way, how to execute single test step in there.. But I need full test case..

 

Next problem is, that event scripts haves other context.. I am unable to call testCase.run()... there ... there is no run method available..

  • def testCase = testRunner.testCase.testSuite.project.getTestSuiteByName("Reusable").getTestCaseByName("dump_DB_roles")
    def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
    def async = false
    String testSuiteName = testRunner.testCase.testSuite.getName();

     

    // this condition is here to avoid, that test case will be executed in never ending cycle.. Is not required to be started once parent testSuite is the same called Reusable.. because there are just test case like methods reused in my tests.

    if (!testSuiteName.equals("Reusable")) {
    log.info "execute the test"
    testCase.run (properties, async)
    }
    else {
    log.info "not executed"}

1 Reply

  • def testCase = testRunner.testCase.testSuite.project.getTestSuiteByName("Reusable").getTestCaseByName("dump_DB_roles")
    def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
    def async = false
    String testSuiteName = testRunner.testCase.testSuite.getName();

     

    // this condition is here to avoid, that test case will be executed in never ending cycle.. Is not required to be started once parent testSuite is the same called Reusable.. because there are just test case like methods reused in my tests.

    if (!testSuiteName.equals("Reusable")) {
    log.info "execute the test"
    testCase.run (properties, async)
    }
    else {
    log.info "not executed"}