cancel
Showing results for 
Search instead for 
Did you mean: 

How to read JSON file using FileWait

SOLVED
Contributor

How to read JSON file using FileWait

 Hi,

I have used the below code to read the Json file using File Wait step in Ready API:

 

uploaded .json file in File Wait Step

 

def jsonfile = context.expand( '${File Wait#fileContent}' ) 

def baselineResp = new JsonSlurper().parseText(jsonfile ) 

 

But I am getting "Text must not be null" error.

Please do the needful on this.

2 REPLIES
Community Leader

Re: How to read JSON file using FileWait

Is your property expansion correct? You can use the right click menu item Get Data to ensure you have the correct value.

 

Also you could add the following line between your two line to help see what is going on.

 

def jsonfile = context.expand( '${File Wait#fileContent}' ) 
log.info(jsonfile)
def baselineResp = new JsonSlurper().parseText(jsonfile) 
Highlighted
Contributor

Re: How to read JSON file using FileWait

Hi,

 

Its working fine.

Thanks.

Watch a new Video
Top Kudoed Authors