Skip to content

Commit 81f5827

Browse files
authored
Add Sample Test Case
1 parent 0bd065e commit 81f5827

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)