Forum Discussion

jbuttimer's avatar
jbuttimer
Contributor
9 years ago

Easy way to set all test cases to NOT abort on error?

Right now I'm haveing to go through a large library of tests and open each test case in order to uncheck the "Abort on Error" check box. Is there a global setting I can use to override this?

 

Thanks!

5 Replies

  • kondasamy's avatar
    kondasamy
    Regular Contributor

    In SoapUI, there is no explicit option to disable the "Abort on Error" option for all the test case in a project, but this could be achived using Groovy script. Please copy the below script and run it using a Groovy test step,

     

    testRunner.testCase.testSuite.project.getTestSuiteList().each
    {
       it.getTestCaseList().each
       {
          //Switch the parameter value to 'true' if you need to enable 'Abort on Error' option
          it.setFailOnError(false)
       }
    }

    While running this script, this would through an information pop up; please ignore it. Hope this answers your query!

     

    Thanks,

    Samy

    • jbuttimer's avatar
      jbuttimer
      Contributor

      Thank you Samy! I will be trying your solution shortly. 

  • kbw's avatar
    kbw
    Contributor

    You can also do it by directly editing your project XML, if you're comfortable doing it that way.  The relevent section look like this:

     

    <con:testCase failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Test Case Name"... etc.

     

    failOnError is the setting for "Abort test if an error occurs".

     

    So, you can simply do a replace all of (I included the testCase element as a precaution only):

    <con:testCase failOnError="true"

    with

    <con:testCase failOnError="flase"

     

    FYI: failTestCaseOnErrors is the setting for "Fail TestCase if it has failed TestSteps".

  • nmrao's avatar
    nmrao
    Champion Level 3

    Not sure from soapUI tool.

     

    But if you open the soapui project xml file, you should be able to see something like this where you can set the value:

     

    <con:soapui-project xmlns:con="http://eviware.com/soapui/config" name="TestAutomation" resourceRoot=""
    soapui-version="4.5.1" abortOnError="false" runType="SEQUENTIAL" defaultScriptLanguage="Groovy"
    activeEnvironment="Default">

     

  • nmrao's avatar
    nmrao
    Champion Level 3

    If you open project xml, you can see the second line as shown below where you can change it though not sure from soapui tool.

    <con:soapui-project name="TestAutomation" resourceRoot="" soapui-version="4.5.1" abortOnError="false" runType="SEQUENTIAL" defaultScriptLanguage="Groovy" activeEnvironment="Default" xmlns:con="http://eviware.com/soapui/config">