This logic hook will either create a new variable with the specified name and value or overwrite the existing variable with the new value. It can be used as either a Bot or User Step.
- On the left navigation pane, head to
Botium Tools & Settings > Test Sets > Your Test Set > Test Cases
- Click the + NEW button to add a new Convo, or select a previously created test case from the list.
- Add a new + USER STEP or + BOT STEP
- Click the Edit icon, or anywhere inside the step, and search the list for
the 'Set Scripting Variable' logic hook.
-
Configure the Logic Hook:
- Variable Name: Specify the name of the variable. Usually, start the variable name without "$". Use "$" only if you need logic hook argument replacement.
-
Value: Enter the new value you wish to assign to the
variable.
- Click the APPLY CHANGES button to complete the step entry.
Note:
Example Botium Script:
#bot
SET_SCRIPTING_MEMORY myVariableName|myVariableValue
Explanation:
-
SET_SCRIPTING_MEMORY
initiates the action to set the scripting variable. -
myVariableName|myVariableValue
assigns the valuemyVariableValue
to the variablemyVariableName
.
For more information on using scripting variables, please read the article Using the Scripting Memory.