How to load a json data file into a variable in robot framework?

后端 未结 5 1653
庸人自扰
庸人自扰 2021-01-02 18:16

I Am trying to load a json data file into a variable directly in Robot Framework. Can anyone please elaborate with an e.g. giving the exact syntax as to how to do it? Thanks

5条回答
  •  感情败类
    2021-01-02 18:46

    There is a library available for this: HttpLibrary.HTTP

    ${json}= | Get file | example.json
    ${port}  | HttpLibrary.HTTP.Get Json Value | ${json} | /port
    log      | ${port}
    

    API Document is available here: http://peritus.github.io/robotframework-httplibrary/HttpLibrary.html

提交回复
热议问题