<
From version < 9.1 >
edited by Outhman Moustaghfir
on 2024/01/30 15:58
To version < 3.4 >
edited by Outhman Moustaghfir
on 2024/01/30 15:04
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -4,7 +4,6 @@
4 4  
5 5  [[image:setvar.png]]
6 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 ==
... ... @@ -21,7 +21,7 @@
21 21   }}}
22 22  
23 23  {{code language="json"}}
24 -{ "var1": "value1", "var2": "value2" }
23 +{ "var1": "value1", "var2": "true" }
25 25  
26 26  {{/code}}
27 27  
... ... @@ -32,13 +32,13 @@
32 32   }}}
33 33  
34 34  {{code language="json"}}
35 -{ "var1": "value1", "var2": "${GetVar;variableName}" }
34 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
36 36  {{/code}}
37 37  
38 38  
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.
40 +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.
42 42  
43 43  == Examples ==
44 44  
... ... @@ -56,7 +56,7 @@
56 56  
57 57  
58 58  {{code language="json"}}
59 -{ "username": "john_doe", "email": "${GetVar;Email}", "isAdmin": "false"}
58 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
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}**.
65 +* Ensure proper syntax for dynamic values using ${GetVar;variableName}.
67 67  
68 68  == Conclusion ==
69 69  
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian