Forum Discussion
- Cizo89Frequent ContributorHi Leo,
try this script for your Project Teardown script:
for (testSuite in project.getTestSuiteList()){
for (i in 1..testSuite.getPropertyCount()){
testSuite.removeProperty(testSuite.getPropertyAt(0).getName())
}
for (testCase in testSuite.getTestCaseList()){
for (i in 1..testCase.getPropertyCount()){
testCase.removeProperty(testCase.getPropertyAt(0).getName())
}
}
}
If you want just to remove all values from those properties, just use method setPropertyValue(String, String) and set the values to empty string or null (depending on your requirements).
Regards,
Marek - Liberty_InformaRegular ContributorHi Leo
Try following script which works awesome. It helps me bringing back soapUI projects to the original state. Before this script developers complained that soapUI showing us files to check-in which we haven't changed. It happens because when you run soapUI project settings.xml and testcases file are updated with the current test data and they are shown as pending changes to check-in into the version control tool. The script helps me avoiding that situation.
It doesn't wipe out properties altogether. It just wipes out values.for( t in project.testSuiteList )
{
for( c in t.testCaseList )
{
clearProperties( c )
clearProperties( t )
}
}
void clearProperties( modelItem )
{
for( n in modelItem.propertyNames )
modelItem.setPropertyValue( n, '' )
}
soapUI guys provided me this script so big thanks should go to them. - hutabarat2014ContributorThank you all.
I will try both scripts now and keep you posted of the result. - hutabarat2014Contributor
- Cizo89Frequent ContributorHi Leo,
that failed because one of your TestSuites or TestCases have no properties.
Just add if statements with following conditions and it should work:
testSuite.getPropertyCount() > 0
testCase.getPropertyCount() > 0
Regards,
Marek