Karate - How to import json data

99封情书 提交于 2019-12-02 01:46:53

Below code is correct:

* def data = read('classpath:init/data.json')

Only you must remove [call]

Yes, read the error message (and the doc) carefully - there is no meaning in 'calling' a JSON file, the moment you read it - you have your re-usable data already. Just do this:

Background:
    * def data = read('classpath:init/data.json')

  Scenario:
    * print data
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!