<
From version < 5.1 >
edited by Outhman Moustaghfir
on 2024/01/30 15:08
To version < 19.1 >
edited by Outhman Moustaghfir
on 2024/09/27 13:40
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -11,8 +11,9 @@
11 11  
12 12  === JSON Format ===
13 13  
14 -[[image:Capture d'écran 2024-01-30 150237.png]]
14 +[[image:1727437198067-371.png]]
15 15  
16 +
16 16  The JSON file for SetVar has a simple structure. It consists of key-value pairs, where the keys represent variable names, and the values can be either static values or dynamic expressions.
17 17  
18 18  ==== Example 1: ====
... ... @@ -21,7 +21,7 @@
21 21   }}}
22 22  
23 23  {{code language="json"}}
24 -{ "var1": "value1", "var2": "true" }
25 +{ "var1": "value1", "var2": "value2" }
25 25  
26 26  {{/code}}
27 27  
... ... @@ -32,13 +32,23 @@
32 32   }}}
33 33  
34 34  {{code language="json"}}
35 -{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
36 +{ "var1": "value1", "var2": "{Env.GetVar;variableName}" }
36 36  {{/code}}
37 37  
39 +== Global Values ==
38 38  
41 +SetVar supports dynamic values using XGlobal before the variable name to make this var accessibel in the parent sceanrio .
42 +
43 +== Examples ==
44 +
45 +
46 +{{code language="json"}}
47 +{ "iXGlobal:Key": "Value" }
48 +{{/code}}
49 +
39 39  === Dynamic Values ===
40 40  
41 -SetVar supports dynamic values using expressions in the ${GetVar;variableName} format. This allows you to reference the values of other variables within the JSON file.
52 +SetVar supports globalvalues using iXPath functions (GetVar, Date, GetTracking...). This allows you to reference the values of other variables within the JSON file.
42 42  
43 43  == Examples ==
44 44  
... ... @@ -52,11 +52,11 @@
52 52  {{/code}}
53 53  
54 54  
55 -=== Using Dynamic Values ===
66 +=== Using Dynamic Values by GetVar function ===
56 56  
57 57  
58 58  {{code language="json"}}
59 -{ "username": "john_doe", "email": "${GetVar;Email}", "isAdmin": "false", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" }}
70 +{ "username": "john_doe", "email": "{Env.GetVar;Email}", "isAdmin": "false"}
60 60  {{/code}}
61 61  
62 62  
... ... @@ -63,7 +63,7 @@
63 63  == Important Notes ==
64 64  
65 65  * Variables set by SetVar can be referenced within the same JSON file or in subsequent scenarios.
66 -* Ensure proper syntax for dynamic values using ${GetVar;variableName}.
77 +* Ensure proper syntax for dynamic values using **iXPath functions**.
67 67  
68 68  == Conclusion ==
69 69  
1727437198067-371.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.omoustaghfir
Size
... ... @@ -1,0 +1,1 @@
1 +34.5 KB
Content
var.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.omoustaghfir
Size
... ... @@ -1,0 +1,1 @@
1 +14.3 KB
Content
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian