From version < 5.1 >
edited by Outhman Moustaghfir
on 2024/01/30 15:08
To version 1.1 >
edited by Outhman Moustaghfir
on 2024/01/30 14:57
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -2,9 +2,6 @@
2 2  
3 3  == Overview ==
4 4  
5 -[[image:setvar.png]]
6 -
7 -
8 8  The SetVar connector is designed to set variables within a scenario by utilizing a JSON file. This connector allows users to define variables and even use dynamic values using expressions.
9 9  
10 10  == Usage ==
... ... @@ -11,8 +11,6 @@
11 11  
12 12  === JSON Format ===
13 13  
14 -[[image:Capture d'écran 2024-01-30 150237.png]]
15 -
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: ====
... ... @@ -20,11 +20,12 @@
20 20  {{{
21 21   }}}
22 22  
23 -{{code language="json"}}
24 -{ "var1": "value1", "var2": "true" }
18 +{{code language="XML"}}
19 +SetVar(variable_name, value, global=False)
25 25  
26 26  {{/code}}
27 27  
23 +{ "var1": "value1", "var2": "true" }
28 28  
29 29  ==== Example 2: ====
30 30  
... ... @@ -31,10 +31,12 @@
31 31  {{{
32 32   }}}
33 33  
34 -{{code language="json"}}
35 -{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
30 +{{code language="XML"}}
31 +SetVar(variable_name, value, global=False)
32 +
36 36  {{/code}}
37 37  
35 +{ "var1": "value1", "var2": "true", "inputFile1": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
38 38  
39 39  === Dynamic Values ===
40 40  
... ... @@ -56,7 +56,7 @@
56 56  
57 57  
58 58  {{code language="json"}}
59 -{ "username": "john_doe", "email": "${GetVar;Email}", "isAdmin": "false", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" }}
57 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
60 60  {{/code}}
61 61  
62 62  
Capture d'écran 2024-01-30 150237.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.omoustaghfir
Size
... ... @@ -1,1 +1,0 @@
1 -14.9 KB
Content
setvar.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.omoustaghfir
Size
... ... @@ -1,1 +1,0 @@
1 -3.6 KB
Content
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian