Ask a Question

How to read JSON file using FileWait

SOLVED
sukanya
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 2
Radford
Super Contributor

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) 

Hi,

 

Its working fine.

Thanks.

cancel
Showing results for 
Search instead for 
Did you mean: