max1965
13 years agoContributor
delete properties
With the following groovy script, soapui delete, from testcase, all the properties beginning with cseq, callid, ...
def delete_properties_udb = context.expand( '${#Global#delete_properties_udb_tc}' )
if ( delete_properties_udb == "Y" )
{
def propertyNames = testCase.getPropertyNames()
for(name in propertyNames){
if ( (name.toString().startsWith("cseq")) || (name.toString().startsWith("callid")) || (name.toString().startsWith("contactUri")) || (name.toString().startsWith("nc")) || (name.toString().startsWith("nonce")) || (name.toString().startsWith("status")) ){
testCase.removeProperty(name);
}
}
}
There is an option to not remove the properties if beginning with a string (i.e: cseq) ?
Thanks
def delete_properties_udb = context.expand( '${#Global#delete_properties_udb_tc}' )
if ( delete_properties_udb == "Y" )
{
def propertyNames = testCase.getPropertyNames()
for(name in propertyNames){
if ( (name.toString().startsWith("cseq")) || (name.toString().startsWith("callid")) || (name.toString().startsWith("contactUri")) || (name.toString().startsWith("nc")) || (name.toString().startsWith("nonce")) || (name.toString().startsWith("status")) ){
testCase.removeProperty(name);
}
}
}
There is an option to not remove the properties if beginning with a string (i.e: cseq) ?
Thanks