Finan
13 years agoFrequent Contributor
Script does not work in soapUI 4.5
Hi,
Since soapUI pro 3.6 we've used a groovy script in the project.save script to clean our properties from obsolete values.
This script no longer works in soapUI pro 4.5 (tested in 4.0 and 3.6.1, and it works).
Can you provide a solution for this problem?
the script:
I get a java.lang.ArrayIndexOutOfBoundsException
Since soapUI pro 3.6 we've used a groovy script in the project.save script to clean our properties from obsolete values.
This script no longer works in soapUI pro 4.5 (tested in 4.0 and 3.6.1, and it works).
Can you provide a solution for this problem?
the script:
removeProjectProperties();
for(testSuite in project.testSuites){
testSuite = project.getTestSuiteByName(testSuite.key);
for(testCase in testSuite.testCases){
testCase = testSuite.getTestCaseByName(testCase.key);
if(testSuite.name.startsWith("Blocks")){ //Blocks testsuites contain reusable testfunctions, all testcase properties within these testsuites can be emptied
//clear testCase properties
int count = testCase.getPropertyCount();
for(int i = 0; i < count; i++){
propertie = testCase.getPropertyAt(i);
propertie.setValue("");
}
}
for(testStep in testCase.testSteps){
testStep = testCase.getTestStepByName(testStep.key);
if(testStep.class.toString().equals("class com.eviware.soapui.impl.wsdl.teststeps.WsdlRunTestCaseTestStep")){
int count = testStep.getPropertyCount();
for(int i = 0; i < count; i++){
propertie = testStep.getPropertyAt(i);
if(propertie.name.startsWith("out_")){
propertie.setValue("");
}
}
}
}
}
}
/*
Remove old project properties:
1.i=0 and will remain so
2.project.getPropertyCount will return a lower value for every execution, (removeProperty)
3.Ultimately getPropertyCount will return 0, exiting the function
*/
void removeProjectProperties(){
for(int i = 0;i<project.getPropertyCount();i){
project.removeProperty(project.getPropertyAt(i).name);
}
}
log.info "Project was cleared of obsolete data";
I get a java.lang.ArrayIndexOutOfBoundsException