I declared an array but every time I turn off Katalon, Katalon loses the array length

1, Steps to reproduce the error:
1.1, Step 1: Create an array like this

           String[] ttArray = new String[10]

           for (int a = 3; a < 10; a++) {
                 (ttArray[a]) = WebUI.getText(findTestObject('2_man hinh gio hang/detail_thanh tien',                       [('index1') : a]))
            }

  1.2, Step 2: Turn off Katalon then turn it back on

2, Error
Katalon loses the array length:
String ttArray = new String

           for (int a = 3; a < 10; a++) {
                 (ttArray[a]) = WebUI.getText(findTestObject('2_man hinh gio hang/detail_thanh tien',                       [('index1') : a]))
            }  

This is a bug of Katalon Studio which is outstanding years long. See

It seems that Katalon team is not going to fix this bug.

A workaround: Don’t use new String[N]; Use new ArrayList<String>() instead. The following post describes it.

1 Like