Open topic with navigation
Using repository variables in scripts
Script variables can only be used in the script they are created in. Repository variables can be used in all scripts recorded or run against an application. Repository variables are defined once and saved with a version in the repository.
For example, a repository variable named loginID is defined for the application. To use the variable in a script, enter the variable name where you want to use it. For example:
PrintLn (loginID)
During playback, the default variable value or the value entered when playback started is used. See Entering repository variable values during recording and playback.
Keep the following in mind:
- If a script variable and repository variable have the same name, the script variable value overrides the repository variable value during playback.
- If a repository variable is declared explicitly before the RunApp or ConnectToProcess statement, users are not prompted to select a variable value unless other repository variables require prompting.
- Repository variables are text values. To use variable values in statements that use other value types, you must convert the values. For example, a variable named Time has a value of 30000. To use the variable in the SetControlSearchTimeout statement, which requires an integer value, you must use the following Integer statement to convert the text value before the SetControlSearchTimeout statement is used:
var=Integer(Time)
.