Forum Discussion
deepesh_jain
15 years agoFrequent Contributor
Hi tlausg,
You can do this easily using groovy script. Access properties on a test case (or a test step) level like below:
If you don't need to update the property itself in each test case and just want to update the property value, remove lines 5 and 6 from the code above and update line 7 as required. You can have this code either from a test case at a suite level and update all the other test cases in that suite, by repating and modifying the lines 4-7 as required.
Hope this helps.
Thanks,
Deepesh Jain
You can do this easily using groovy script. Access properties on a test case (or a test step) level like below:
def project = testRunner.testCase.testSuite.project ;
def tsuite = testRunner.testCase.testSuite ;
def tcase = testRunner.testCase;
test1 = project.testSuites["${tsuite.getName()}"].testCases["${tcase.getName()}"];
test1.removeProperty("device");
test1.addProperty("newProperty");
test1.setPropertyValue("newProperty","newValue");
If you don't need to update the property itself in each test case and just want to update the property value, remove lines 5 and 6 from the code above and update line 7 as required. You can have this code either from a test case at a suite level and update all the other test cases in that suite, by repating and modifying the lines 4-7 as required.
Hope this helps.
Thanks,
Deepesh Jain