File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,20 @@ pip install -U robotframework-jsonlibrary
2525```
2626# Example Test Case
2727
28- ** * Settings ** * | |
29- -----------------|--------------|
30- Library | JSONLibrary |
31- Library | Collections |
28+ ** * Settings ** * | | | | |
29+ ----------------- |-------------------- |----------------- |----------- |----------------- |
30+ Library | JSONLibrary | | | |
31+ ** * Test Cases *** | | | | |
32+ ${json_obj}= | Load JSON From File | example.json | | |
33+ ${object_to_add}= | Create Dictionary | country=Thailand | | |
34+ ${json_obj}= | Add Object To Json | ${json_obj} | $..address | ${object_to_add} |
35+ ${value}= | Get Value From Json | ${json_obj} | $..country | |
36+ | Should Be Equal As Strings | ${value[ 0] } | Thailand | | |
37+ | ${value_to_update}=| Set Variable | Japan | | |
38+ | ${json_obj}= | Update Value To Json | ${json_obj} | $..country | ${value_to_update}|
39+ | Should Be Equal As Strings | ${json_obj[ 'country'] | ${value_to_update} | | |
40+
41+
3242
3343
3444
You can’t perform that action at this time.
0 commit comments