Forum Discussion
- venkateshAousul8 years agoNew Contributor
Hi Rao,
our project had a requirement, where we need to create the testsuite and test cases using groovy script.
In that case we have created 2 interfaces one for the old API and other for the new API. each test case contains the first API and second api rest steps and followed by a groovy script to compare.
Now the problem is we need set the resource path dynamically by reading it from excel.When I try with the below code which has been suggested by you, then following error message has been thrown: "ERROR:groovy.lang.MissingPropertyException: No such property: submit for class".
Please help me in setting the resource path and query parameters dynamically. Do I need to place any jars ??
Code for reference:
RestRequestStepFactory rest = new RestRequestStepFactory()
def restServiceConfig = RestServiceConfig.Factory.newInstance()restServiceConfig.setType("restrequest")
RestService restService = project.getInterfaceList()[0]RestResource resource = restService.getOperationAt( 0 );
RestRequest request = resource.getRequestAt( 0 );
submit.request.setPath(uri1)
TestStepConfig testStepConfig = RestRequestStepFactory.createConfig(request, d[3] );
def teststep = tc.addTestStep(testStepConfig)
teststep.setDisabled(true)Note Here d[3] is the cell value which reads from the excel sheet, similarly uri1 is assigned by the cell value d[0]
Regards,
Venkatesh
- nmrao8 years agoChampion Level 3Still not sure why it is like that. Probably, you are not using it correctly.
Request you to refer below soapui documentation and change the project accordingly.
https://www.soapui.org/rest-testing/understanding-rest-parameters.html- sathyarajg7 years agoOccasional Contributor
Its needed when we switch to the new version of resource like versions.
/v1/service to /v2/service.
Related Content
- 6 years ago
- 11 years ago