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

1 ACCEPTED SOLUTION

Accepted Solutions
nmrao
Community Hero

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

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.

View solution in original post

6 REPLIES 6
nmrao
Community Hero

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

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.

View solution in original post

JT7
Occasional Contributor

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

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

 

Thanks!

serto
New Contributor

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

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

 

nmrao
Community Hero

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

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


Regards,
Rao.
rajash
Contributor

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

to remove propety value from teststep properties. 

 

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

_ivanovich_
Frequent Contributor

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

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: