0
*** Keywords ***

Test Data From JSON
    ${json} =    get file    C:/development/robot-scripts/TestProj/JsonFiles/TestData.json  ->[Absolute path works fine]
    
    ${json} =    get file    ${CURDIR}/TestData.json  ->[${CURDIR}: shows error variable definition not found]

    ${object} =    evaluate    json.loads('''${json}''')    json
    log    Hello, my name is ${object["un"]} ${object["pwd"]}    WARN

Here Absolute path to json file works fine. but i am not able to parse json data with relative path. Please help.

Ramii
  • 111
  • 1
  • 11
  • 2
    The simple relative path `TestData.json` refers to a file in the current working directory. Perhaps see also [Difference between `./` and `~/`](https://stackoverflow.com/a/55342466/874188) – tripleee Apr 25 '21 at 08:19
  • 1
    If you add `Log To Console CURDIR: ${CURDIR}`, maybe you can see why the "relative" doesn't work .. – rasjani Apr 26 '21 at 09:19
  • Thanks guys Difference between ./ and ~/ – tripleee is a ust read. It resolved my issue. – Ramii Apr 26 '21 at 12:23

0 Answers0