Forum Discussion

678's avatar
678
Regular Contributor
6 years ago
Solved

Test Suite is failing when executing command line where as passing using ReadyApi GUI

Test Suite is failing when executing command line where as passing using ReadyApi GUI    Project 1     Test Suite 1(Functions)     Test Suite 2 (Actual Test Cases)             TestCase1 (De...
  • KonstantinosLps's avatar
    6 years ago

    The problem is that the workspace instance is not available when you execute via command line.

     

    Try use this code instead as proposed in the link i've send you above:

    import com.eviware.soapui.model.project.ProjectFactoryRegistry
    import com.eviware.soapui.impl.wsdl.WsdlProjectFactory
    
    def workspace = testRunner.testCase.testSuite.project.workspace
    def testProject = (workspace==null) ? 
      ProjectFactoryRegistry.getProjectFactory(WsdlProjectFactory.WSDL_TYPE).createNew("<path to your project>.xml") :
      workspace.getProjectByName("ViewingCardManager_v15B4.0")
    if(!testProject.open && workspace!=null) workspace.openProject(testProject)
    
    testProject.properties["mqResponse"].value = "blahblah"