Forum Discussion

rgrbhorizonte's avatar
14 years ago

Call a mysql dump before/after run a test case

Hello!

I would like to call before or after run a test script, the dump of the database and restore the state of my bank after running the tests. Can you help me how to do this in soapUI? How to call a mysql dump on SoapUi?

1 Reply

  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    Hi,
    if you wanted to call a test case before current test case running, maybe you can try to copy the code below into your related test script (just need to replace name of test case you invoked)


    import com.eviware.soapui.support.types.StringToObjectMap
    def tsr = context.getProperty( "#TestSuiteRunner#" )
    if( tsr != null ){

    testRunner.testCase.testSuite.getTestCaseByName("TestCaseName").run(new StringToObjectMap(context), false)

    }