Forum Discussion
francisbrochu
Occasional Contributor
context.setProperty('idEna','2334') log.info context.getProperty('idEna') log.info ${idEna}
My first log.info works, but not the second one :
groovy.lang.MissingMethodException: No signature of method: Script5.$() is applicable for argument types: (Script5$_run_closure1) values: [Script5$_run_closure1@4e3c1551] Possible solutions: is(java.lang.Object), run(), run(), any(), use([Ljava.lang.Object;), any(groovy.lang.Closure) error at line: 4
nmrao
9 years agoChampion Level 3
Q: How to set a property to context in Groovy Script?
A: context.myPropertyName = 'myValue'
Q: How to get a context property?
A#1: In Groovy Script (exactly opposite to set)
def val = context.myPropertyName
log.info val
A#2: In Request step such as SOAP / REST
like rupert_anderson told,
xml:
<xmlElement>${myPropertyName}</xmlElement>
json :
{ "property" : "${myPropertyName}"}
Related Content
- 4 years ago
- 7 years ago
Recent Discussions
- 15 years ago