Forum Discussion

ahabib's avatar
ahabib
Occasional Contributor
5 years ago
Solved

problem with wsdl.wsdlprojectpro

Im trying to run a testcase from a groovy script, this is the code :

import com.eviware.soapui.impl.wsdl.WsdlProjectPro

def x =testRunner.testCase.testSuite.project.getPath()

WsdlProjectPro project = new WsdlProjectPro(x) 
testSuite = project.getTestSuiteByName("compositionOnes");
testCase0 = testSuite.getTestCaseByName("getToken");
testCase = testSuite.getTestCaseByName("insert - Success");
runner0 = testCase0.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);

runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);
def response = context.expand( '${#[compositionOnes#insert - Success#insert]#Response}' )

 

 

for some reason the script result is null unless i replace

WsdlProjectPro project = new WsdlProjectPro(x)  

with

project = testRunner.testCase.testSuite.project.workspace.getProjectByName("soapUIv3")

 if i do this it will work but i need to use wsdl because i have to use testrunner.bat later 

  • Hi ahabib,

     

    You can define the project like this;

     def project = context.getTestCase().getTestSuite().getProject(); 

1 Reply

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi ahabib,

     

    You can define the project like this;

     def project = context.getTestCase().getTestSuite().getProject();