Ask a Question

how clean output propertis of runTestCaseTestStep form groovy

vikititor
Contributor

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 10
nmrao
Champion Level 2

Please looks at this thread and script provided there inside the referenced topic and see that is related
https://community.smartbear.com/t5/ReadyAPI-Feature-Requests/Saving-without-property-values/idi-p/15...


Regards,
Rao.

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
Champion Level 2

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?



Regards,
Rao.

1. yes obviously.. input properties are static. 

2. yes all the output properties are dynamic - obviously.. This I need to clear before project is saved.

a. yes.. obviously.. name of property for runTestCaseTestSteps are statically defined.

b. yes.. I am using hash to avoid clearing.. as it is in my script.

 

nmrao
Champion Level 2

Thanks for details.

If the inputs are static, then what is the use?
I believe each test case must be passing some values to "run test case" step. Isn't it?


Regards,
Rao.

As I wrote .. I have a lot of tests.. Now.. when action is repeated often.. then I am developing reusable test case (like for data preparation - submit some batch of requests or check data by the same way, just other regexp patterns).

So I have 100 tests which are calling this reusable test (for data preparation or check the assertions in LOG file). So each of this 100 tests haves input values statically defined.. I need to commint them in to VCS.

BUT the target test produce some output propertie.. which I can use in parent test (one of the 100) mainly the output can be like decrypted data, produced some complicated input for my test.

So this I dont want to commint to the VCS (GIT). 

 

In my 100 parent tests I have some properties - a lot of them is runtime (just for debuging, reusing in multiple test steps). This I am cleaning in my script. WHEN in my test is some property, which I need to have in static, then this porperty name is using hash in property name as prefix.

 

Now.. the target tests are cleared as well.. because is in test case leve.. All is OK.. 

BUT the calling the reusable test case the RUN TEST CASE STEP is not cleared. I can get property value, I can even clean them .. BUT I can not distinguish, if is input or output.

 

If this is not clear.. then I dont know..

Question is simple:

how to get idea, if the property is output one for the test step Run test case.. 

Nothing else. 

If is top secret.. then dont provide the help.. 

I can report the enhancement for ReadyAPI.. but a lot of enhancements reported.. and nothing added.. 

I dont expect, that smarbear will develop and add some chck box.. 

 

So in the end.. I will check tons of rows during commint again and again.. to avoid, that I am commiting some runtime ourput properties..

nmrao
Champion Level 2

I couldn't follow the above long read.
Here is the solution provided in this topic. You can try it
https://community.smartbear.com/t5/API-Functional-Security-Testing/Solution-Script-to-Cleanup-of-Cus...
If needed any modifications, then it can be done.


Regards,
Rao.

not helped me..

question still open. 

 

maybe is time to switch to other tool.. 😞

cancel
Showing results for 
Search instead for 
Did you mean: