We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More

Forum Discussion

mpw83's avatar
mpw83
Frequent Contributor
7 years ago
Solved

Remove all the properties starts with given value

I found that I can use the following groovy script line to remove the given property  testRunner.testCase.removeProperty('ScheduleID'); In my test case, I have properties like 'ScheduleID0' , 'Sc...
  • HimanshuTayal's avatar
    7 years ago

    Hi mpw83 ,

     

    You can use more of groovy to find solution of your problem, first count the number of properties stored under Test Case custom properties and then delete the selected properties, refer below code for reference:

     

    def targetTestCase = testRunner.testCase;
    def propList = targetTestCase.getPropertyNames()
    propList.each{
    	if(it.contains("ScheduleID")){
    		targetTestCase.removeProperty(it);
    	}
    	else{
    		//Do nothing
    	}
    }