Forum Discussion
wdowling
14 years agoOccasional Contributor
I think based on the code below targetStep.properties.count() would also work to get the total elements in the properties list. but if u google the list structure in groovy it should tell you.
def targetStep = testRunner.testCase.getTestStepByName( "Void request - REST Version 1" );
targetStep.properties.each(){element ->
if (element.value.toString() ==~ /.*RestTestStepProperty.*/){
// this is a property ffor the request defined by the WADL
log.info(element.key) // the name of the property
log.info(element.value.getType()) // get the type assigned to the property by the WADL
}
}
def targetStep = testRunner.testCase.getTestStepByName( "Void request - REST Version 1" );
targetStep.properties.each(){element ->
if (element.value.toString() ==~ /.*RestTestStepProperty.*/){
// this is a property ffor the request defined by the WADL
log.info(element.key) // the name of the property
log.info(element.value.getType()) // get the type assigned to the property by the WADL
}
}