ME_Bank_Support
10 years agoOccasional Contributor
Dynamic WSDL definition update and update test request
Hello
i want to know how to update WSDL definitions dynamically and update the test requests in the test suit if any definition updated. I know we can do this manually but we got too many WSDl definitions and communication is really bad among different providers. So we don't know when and which definition is getting updated so unable to do it manually. when running the targeted test suit i need to update the latest definition first and then run the test suit on the updated test requests. I created a groovy script but its not working as expected. Is there any better way to implement this or can you please correct my script especially the parameters that i am passing to Create test request function.
import com.eviware.soapui.impl.wsdl.actions.iface.UpdateInterfaceAction;
import com.eviware.soapui.impl.*;
import com.eviware.soapui.impl.wsdl.*;
import com.eviware.soapui.config.*;
import com.eviware.soapui.config.InterfaceConfig.Factory;
import java.net.*;
import java.io.*;
import java.lang.*;
InterfaceConfig config = InterfaceConfig.Factory.parse(new URL("http://wbmgwy1-dev3.metest.local:8655/ws/MEB_SM_ProductMgmt.WS.provider.v1:ProductService?WSDL"));
WsdlProject project = new WsdlProject("S:\\Change & Technology\\Transformation Project\\04 Projects\\11 Origination\\06 .Test\\R2 System Testing\\04 Test Scripts\\Services Testing\\workspace\\Prasanth-soapui-project.xml");
def li= project.getInterfaceList()
log.info li.size()
Iterator iter=li.iterator()
while(iter.hasNext()){
Object element=iter.next()
log.info element.getName()
// log.info element.get
//element.reload()
log.info element.getInterfaceType()
def nli1=com.eviware.soapui.impl.wsdl.actions.iface.UpdateInterfaceAction.recreateRequests( element,false,false,true,false)
def nli=com.eviware.soapui.impl.wsdl.actions.iface.UpdateInterfaceAction.recreateTestRequests( element,false,false,true,false)
log.info nli.size()
Iterator iter1=nli.iterator()
while(iter1.hasNext()){
Object element1=iter1.next()
log.info element1.getName() }
// log.info element.getDefinition()
// element.updateDefinition(
}
project.save()
project.release()
i want to know how to update WSDL definitions dynamically and update the test requests in the test suit if any definition updated. I know we can do this manually but we got too many WSDl definitions and communication is really bad among different providers. So we don't know when and which definition is getting updated so unable to do it manually. when running the targeted test suit i need to update the latest definition first and then run the test suit on the updated test requests. I created a groovy script but its not working as expected. Is there any better way to implement this or can you please correct my script especially the parameters that i am passing to Create test request function.
import com.eviware.soapui.impl.wsdl.actions.iface.UpdateInterfaceAction;
import com.eviware.soapui.impl.*;
import com.eviware.soapui.impl.wsdl.*;
import com.eviware.soapui.config.*;
import com.eviware.soapui.config.InterfaceConfig.Factory;
import java.net.*;
import java.io.*;
import java.lang.*;
InterfaceConfig config = InterfaceConfig.Factory.parse(new URL("http://wbmgwy1-dev3.metest.local:8655/ws/MEB_SM_ProductMgmt.WS.provider.v1:ProductService?WSDL"));
WsdlProject project = new WsdlProject("S:\\Change & Technology\\Transformation Project\\04 Projects\\11 Origination\\06 .Test\\R2 System Testing\\04 Test Scripts\\Services Testing\\workspace\\Prasanth-soapui-project.xml");
def li= project.getInterfaceList()
log.info li.size()
Iterator iter=li.iterator()
while(iter.hasNext()){
Object element=iter.next()
log.info element.getName()
// log.info element.get
//element.reload()
log.info element.getInterfaceType()
def nli1=com.eviware.soapui.impl.wsdl.actions.iface.UpdateInterfaceAction.recreateRequests( element,false,false,true,false)
def nli=com.eviware.soapui.impl.wsdl.actions.iface.UpdateInterfaceAction.recreateTestRequests( element,false,false,true,false)
log.info nli.size()
Iterator iter1=nli.iterator()
while(iter1.hasNext()){
Object element1=iter1.next()
log.info element1.getName() }
// log.info element.getDefinition()
// element.updateDefinition(
}
project.save()
project.release()