- This line was added.
- This line was removed.
- Formatting was changed.
There are three types of variables supported in Katalon Studio, as below:
A private variable can be referred only within the scope of the test case where it is defined.
Public Local Variable
A public variable can be exposed as the parameter for the test case where it is defined
A global variable can be referred anywhere of your project.
Refer to the subsequence sections for how to define a variable of each type.
Variables defined in Scripting view of Test Cases are classified as private variables. These variables will only be accessible within the scope of your Groovy class. For example:
// x is defined as a variable of String type String x = "Hello"; // y is defined as a variable of int type int y = 5; // The value of the variables are printed to the console println(x); println(y);
You can manage the list of public variables of your test case by using the Variables tab in your Test Case Editor.
- Switch to Variables tab of your Test Case. Then click Add.
- A new row is added to the variable list. Modify the variable details and save the test case when you're done.
- Variables defined in this list can be utilized as parameters for the test case in other configurations. (e.g. input data for keywords in Test Case Manual View or params when binding Data for Test Execution)
You can manage the list of global variables in your project by using the Global Variables view.
- Expand the Global Variable view. Then click Add.
- The New variable dialog is displayed. Specify details for the variable then click OK.
- The variable will be added to the Global Variable list accordingly.
- Global variables can be utilized by any test case across a project. (e.g. input data for keywords in Test Case Manual View or params when binding Data for Test Execution)
|Table of Contents|