Forum Discussion
SmartBear_Suppo
11 years agoSmartBear Alumni (Retired)
Hi,
You can use this groovy script to remove the empty tags using it with the RequestFilter.filterRequest event.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def stepName = context.getCurrentStep().getLabel()
def holder = groovyUtils.getXmlHolder( stepName + "#Request" )
// set default value here
def defaultVal = ""
for( item in holder.getDomNodes( "//*[. = '']" )){
holder.removeDomNodes("//"+item.nodeName)
}
// update request
holder.updateProperty()
// write updated request back to teststep
context.requestContent = holder.xml
Regards,
Marcus
SmartBear Support
You can use this groovy script to remove the empty tags using it with the RequestFilter.filterRequest event.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def stepName = context.getCurrentStep().getLabel()
def holder = groovyUtils.getXmlHolder( stepName + "#Request" )
// set default value here
def defaultVal = ""
for( item in holder.getDomNodes( "//*[. = '']" )){
holder.removeDomNodes("//"+item.nodeName)
}
// update request
holder.updateProperty()
// write updated request back to teststep
context.requestContent = holder.xml
Regards,
Marcus
SmartBear Support
Related Content
- 6 years ago
- 14 years ago