Forum Discussion

jwright's avatar
jwright
Occasional Contributor
13 years ago

context.setProperty and context.getProperty

I have 2 groovy scripts inside a testsuite in one groovy script i am doing the following step

context.setProperty( "values", list );
context.setProperty( "index", 0 );

log.info("Values " + context.getProperty( "values" ))
log.info("Index " + context.getProperty( "index" ))

Log file has:
Tue Mar 13 09:33:50 CDT 2012:INFO:Values [9019439!2009-04-30T00:00:00, 9021279!2009-02-28T00:00:00, 9021295!2009-03-01T00:00:00, 9021567!2009-01-01T00:00:00]
Tue Mar 13 09:33:50 CDT 2012:INFO:Index 0

Now in another groovy script I am performing

def values = context.getProperty( "values" );
def index = context.getProperty( "index" );

log.info( "Values " + values );
log.info( "Index " + index);

I am getting back null values and I dont understand why. I have done this before in the past and it worked just fine.
No RepliesBe the first to reply