Forum Discussion

vikititor's avatar
vikititor
Contributor
4 years ago

how clean output propertis of runTestCaseTestStep form groovy

Because my tests are really huge.. And ofte use runTestCase test step.. to dont repeat same again and again.. 

And because I use composite project in GIT. 

I need to clean out all output parameters of runTestCaseTestStep by groovy script when project is saved.

Goal is to dont commit output values - because they are changed each time, but irelevent - not need to be in GIT.

 

Here is my script for deletion the test case properties (except specific one starting with prefix).. I can display even the properties names and values of runTestCaseTestStep.. but no idea to say.. which one is output and no idea how to clean them.

Any ideas?

Basically I thing this must be in UI of the readyAPI some check box.. But is not.. ğŸ˜ž

 

log.info "*********** SAVE PROJECT script ***********";
log.info "Cleaning the properties values - start"
for ( t in project.getTestSuiteList() ) {
	log.info " -s " + t.name 
	//log.info "-suite propertis count: " + t.getPropertyCount()
	
	for ( c in t.getTestCaseList() ) {
		log.info " --tc " + c.name
		//log.info " -- suite propertis count: " + c.getPropertyCount()
		
		if (c.getPropertyCount() > 0) {
			
			for( n in c.propertyNames ){
				log.info " --- tcp " + n + " value: " + c.getPropertyValue(n)
				if ((n.substring(0,1) == "#")||(n.substring(0,1) == "*")){
					log.info " ---- cleaning skipped"
					}
				else
					{if (n == "countDown") {
						c.setPropertyValue( n, '0')		
						}  					
					else {
						c.setPropertyValue( n, '')
						}
					}				
				}
			}	   	
		}
	}

log.info "Cleaning the properties values - finished"

10 Replies

    • vikititor's avatar
      vikititor
      Contributor

      When I will do that.. even input property values will be not stored in project. Then is a problem.. 

      I have been changed the input property.. form some reason.. but will be not stored.. 

      This I dont want.

       

      I must know the pbject model of ReadyAPI.. to found out the way.. how to get value and assign another one the null.. 

      Does anybody know.. which one class is for test step run test case? and how to get idea, if the property is input or output? 

      I can see the output properties are visible in test case XML file.. so it must be accessible form groovy.. 

      Thanks

       

      • nmrao's avatar
        nmrao
        Champion Level 3

        Would you please clarify few points?

        1. Do you have any static values for certain properties? And you do not want to clean them?

        2. Do you create any properties dynamically ? Which is why you want to clean them?

           a. Are these dynamc property names fixed?

           b. Are you ok to use some prefix if the number of dynamic properties created are not fixed? So that you can identify them for clean up?