Forum Discussion

srinivas_das_l's avatar
srinivas_das_l
Contributor
16 years ago

How to remove testcase using testSuite Teardown script ????

Hi All,

        Can anyone tell me how to remove testcases using testSuite teardown script ?
I can able to add a testcase using the following code ,

def pname = testRunner.testCase.testSuite.addNewTestCase("Success Case")

Waiting for the response ..

Thanks & Regards,
Srinivas
  • Hi!

    you need to specify the actual testcase, ie

    testSuite.removeTestCase( testSuite.getTestCaseByName( "TestCase 1" ))

    regards,

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    oh I'm sorry.. that should have been just

    testSuite.removeTestCase(.. )

    since the testSuite is available as a property in the tear down script

    regards!

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you need to specify the actual testcase, ie

    testSuite.removeTestCase( testSuite.getTestCaseByName( "TestCase 1" ))

    regards,

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    sure.. use

    testRunner.testCase.testSuite.removeTestCase( pname )

    regards!

    /Ole
    eviware.com
  • But see the code u have written is for testCase level.But I want in the testSuite level

    In testSuite level, testRunner variable is not allowed
  • I tried with the above code but didn't get the result
    It gave the following error message

    groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlTestSuite.removeTestCase() is applicable for argument types: (java.lang.String) values: {"Test Case"}
  • I tried with the above code but didn't get the result
    It gave the following error message

    groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlTestSuite.removeTestCase() is applicable for argument types: (java.lang.String) values: {"Test Case"}