Ask a Question

How to i clear the property values of a TestCase or TestSuite using groovy script?

SOLVED
livevox084
Occasional Contributor

How to i clear the property values of a TestCase or TestSuite using groovy script?

Hi Support,

I am using Ready API 1.3.1

How to i clear the property values of a TestCase or TestSuite using groovy script?

 

Thanks,

Rajendra

6 REPLIES 6
nmrao
Champion Level 2

Below can be used for test case

 

context.testCase.properties.each {
	context.testCase.properties[it.key].value = ''
}

for test suite 

replace context.testCase with context.testCase.testSuite in the above code snippet.



Regards,
Rao.
JT7
Occasional Contributor

Copied it into the Test Case TearDown Script section and it works great.

 

Thanks!

serto
New Contributor

How i have to change the code for deleting values from TestStep Properties? 

 

nmrao
Champion Level 2

Create new topic with details, please. Original question is already marked answered.


Regards,
Rao.

to remove propety value from teststep properties. 

 

testRunner.testCase.getTestStepByName("Properties").properties.each {
testRunner.testCase.getTestStepByName("Properties").properties[it.key].value = ""
}

_ivanovich_
Frequent Contributor

How do we clear just one property from project.

I don't want to remove the property.

I see how to clear all properties but how to clear just one property by its name? 

using groovy.

cancel
Showing results for 
Search instead for 
Did you mean: