Forum Discussion

lings24's avatar
lings24
Occasional Visitor
8 years ago

How to create a Rest Request Test Step and link it to a Resource Method with Groovy/Java code?

I am working on creating a SOAP UI project without using SOAP UI tool but only by using Groovy code.

 

I have successfully created a project, test suite and also imported a WADL.

I do not know how to add a REST Request test step and link this request to the WADL method.

 

Any help would be appreciated. Thank you

 

 

WsdlProject project = new WsdlProject()

RestService service = (RestService)project.addNewInterface("RestPostXml", RestServiceFactory.REST_TYPE)
WadlImporter importer = new WadlImporter(service)
String filePath = "PATH_TO_WADL.wadl"
importer.initFromWadl(Paths.get(filePath).toUri().toURL().toString())

WsdlTestSuite testSuite = project.addNewTestSuite("TestSuite1")
WsdlTestCase testCase = testSuite.addNewTestCase("TestCase1")
// Need to add REST request test step to the test case. I do not know how.