Forum Discussion

subhaD's avatar
subhaD
Contributor
6 years ago

groovy : context expand variable parametrize user defined variable

I am trying to pass  variable in to context.expand to get data from response, having trouble with this, any quick response is appreciated

 

def aaa = context.expand( '${1st Call#Response#$[\'data\'][\'res\'][\'b\'][0][\'aaa\']}' )
def response = context.expand( '${2nd call#Response#$[\'data\'][\'res\'][\'reportDownloadUrls\'][\'547851482\']}' )

 

I want to pass aaa variable instead of 547851482

I am writing this in groovy script test step, help debug this

  • Lucian's avatar
    Lucian
    Community Hero

    I don't know how to help you with this.

     

    However, if you would tell me what you are trying to achieve, I might be able to provide you with a different solution.

  • The part of URL in the second call response is based on the value sent in first call

    So am trying to parametrize the value for URL using the value from first call