How to read JSON file using FileWait
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018
08:05 AM
07-12-2018
08:05 AM
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.
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018
08:21 AM
07-12-2018
08:21 AM
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)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018
08:43 AM
07-12-2018
08:43 AM
Hi,
Its working fine.
Thanks.
