Forum Discussion
viswaguru3
New Contributor
Hi ,
All Here is solution for changing Resource path
import com.eviware.soapui.impl.rest.RestResource
import java.io.*;
def project = testRunner.testCase.testSuite.getProject()
String restServiceName = "web-rs-v1.wadl"
List<RestResource> ops = project.getInterfaces()[restServiceName].getOperationList()
log.info("ops ::"+ops);
log.info("ops size ::"+ops.size());
for (RestResource restResource : ops) {
String pathStr = restResource.getFullPath();
log.info("pathStr first-->"+restResource.getFullPath());
if (!pathStr.contains("AA01"))
{
restResource.setPath(pathStr.replace("/web-rs-v1", "/AA01"));
}
else if(pathStr.contains("AA01"))
{
restResource.setPath(pathStr.replace("/web-rs-v1/AA01", ""));
}
log.info("pathStr After-->"+restResource.getFullPath());
pathStr=null;
}
All Here is solution for changing Resource path
import com.eviware.soapui.impl.rest.RestResource
import java.io.*;
def project = testRunner.testCase.testSuite.getProject()
String restServiceName = "web-rs-v1.wadl"
List<RestResource> ops = project.getInterfaces()[restServiceName].getOperationList()
log.info("ops ::"+ops);
log.info("ops size ::"+ops.size());
for (RestResource restResource : ops) {
String pathStr = restResource.getFullPath();
log.info("pathStr first-->"+restResource.getFullPath());
if (!pathStr.contains("AA01"))
{
restResource.setPath(pathStr.replace("/web-rs-v1", "/AA01"));
}
else if(pathStr.contains("AA01"))
{
restResource.setPath(pathStr.replace("/web-rs-v1/AA01", ""));
}
log.info("pathStr After-->"+restResource.getFullPath());
pathStr=null;
}
ktmrock
7 years agoOccasional Contributor
This worked for me. Thank you!
Related Content
- 12 years agoMartinSpamer
- 9 months agoRichardPla
- 3 years agoaaronpliu