Forum Discussion
SmartBear_Suppo
15 years agoSmartBear Alumni (Retired)
Hello,
If you're just interested in reading the values of properties, you should use Property Expansions, like
(note the required use of single quotes). If you need write access, or need to access properties in another TestSuite or TestCase, you will need to access the properties "manually" For example:
Regards,
Dain
eviware.com
If you're just interested in reading the values of properties, you should use Property Expansions, like
context.expand('${#Project#P1}')
(note the required use of single quotes). If you need write access, or need to access properties in another TestSuite or TestCase, you will need to access the properties "manually" For example:
//Access property 'C1' in current TestCase:
def property = testRunner.testCase.properties['C1']
//Access property 'T1' in current TestSuite:
def property = testRunner.testCase.testSuite.properties['T1']
//Access property 'T2' in TestSuite 'TS2' (which is different from the current TestSuite):
def property = testRunner.testCase.testSuite.project.testSuites['TS2'].properties['T2']
//Once you have a reference to the property you can read or write the value:
property.value = 'new value'
log.info property.value
Regards,
Dain
eviware.com