Katalon Studio should automatically sort the list of Global Variables

Poorman’s resolution is to edit the code manually by text editor. Here I would show you how. Here I am using Katalon Studio 5.4.2

(1) Stop your Katalon Studio, or close the Project
(2) In Windows Explorer or Mac Finder, locate the project folder
(3) In the project folder, locate Profiles folder
(4) In the Profiles folder, you will find one or more *.glbl file(s). For example, default.glbl

(5) Open the default.glbl file with your favorite Text editor. The file is a xml text like this:

<?xml version="1.0" encoding="UTF-8"?>
<GlobalVariableEntities>
   <description></description>
   <name>default</name>
   <tag></tag>
   <defaultProfile>true</defaultProfile>
   <GlobalVariableEntity>
      <description></description>
      <initValue>'John Doe'</initValue>
      <name>Username</name>
   </GlobalVariableEntity>
   <GlobalVariableEntity>
      <description></description>
      <initValue>'ThisIsNotAPassword'</initValue>
      <name>Password</name>
   </GlobalVariableEntity>
   <GlobalVariableEntity>
      <description></description>
      <initValue>'demoaut.katalon.com'</initValue>
      <name>Hostname</name>
   </GlobalVariableEntity>
</GlobalVariableEntities>

(6) The order of GlobalVariables in UI is (seems to be) determined by the order of <GlobalVariableEntity> nodes in the *.glbl file.

(7) Carefully edit the *.glbl file to sort them as you want. For example

   <!-- moved up -->   <GlobalVariableEntity>
      <description></description>
      <initValue>'demoaut.katalon.com'</initValue>
      <name>Hostname</name>
   </GlobalVariableEntity>
   <!-- also moved up -->   <GlobalVariableEntity>
      <description></description>
      <initValue>'ThisIsNotAPassword'</initValue>
      <name>Password</name>
   </GlobalVariableEntity>
   <!-- down -->
   <GlobalVariableEntity>
      <description></description>
      <initValue>'John Doe'</initValue>
      <name>Username</name>
   </GlobalVariableEntity>

(8) restart Katalon Studio and open the project.

how_to_sort_GlobalVariables_manually.PNG

3 Likes