Script code vanished when a test case is renamed

I checked the latest v8.3.5. The bug still persists.

I would warn all Katalon Studio users.

DO NOT RENAME TEST CASES.

You may lose your codes.

If necessary, take a backup of your project before renaming your test cases.

Hi @kazurayam,

The ticket corresponding to this issue is in our backlog and we’ll try to fix them in the soonest release.
Sorry for the inconvenience.

Nam Nguyen.

Hello Team,

Any solution ? There should be a hot fix for this problem and it should not be in backlog.

This might cause some users to lose there work entirely. Katalon is a testing tool and looks like the tool itslef is not getting tested.

1 Like

I can’t believe that Katalon Team is not providing us a hot fix to this issue yet.

I just experienced the same thing. After renamed test case the script disappeared.
I am using Katalon Studio 8.4.1

Katalon Studio v8.5.5 still has this bug.

I’ve lost 6 scripts in the last two days to this issue before figuring out what the cause was.

  • macOS 12.6
  • Katalon Studio 8.3.0

I reproduced this problem.

(1) I created a new project
(2) I created a test case at Test Cases/sub/subsub/TC1. I wrote the script as follows:

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.comment("Hello, I am TC1!")

The folder tree looked as follows:

$ tree .
.
├── Checkpoints
├── Data Files
├── Drivers
├── Include
│   ├── config
│   │   └── log.properties
│   ├── features
│   └── scripts
│       └── groovy
├── Keywords
├── Libs
│   ├── CustomKeywords.groovy
│   └── internal
│       └── GlobalVariable.groovy
├── Object Repository
├── Plugins
├── Profiles
│   └── default.glbl
├── Reports
│   └── Self-healing
│       └── broken-test-objects.json
├── Scripts
│   └── sub
│       └── subsub
│           └── TC1
│               └── Script1675690524595.groovy
├── Test Cases
│   └── sub
│       └── subsub
│           └── TC1.tc
├── Test Listeners
├── Test Suites
├── TestScritVanishesWhenRenamed.prj
├── bin
│   ├── groovy
│   ├── keyword
│   ├── lib
│   │   ├── CustomKeywords.class
│   │   └── internal
│   │       └── GlobalVariable.class
│   ├── listener
│   └── testcase
├── build.gradle
├── console.properties
└── settings
    ├── external
    │   ├── com.kms.katalon.composer.execution.settings.properties
    │   └── com.kms.katalon.core.db.DatabaseSettings.properties
    └── internal
        ├── com.kms.katalon.composer.testcase.properties
        ├── com.kms.katalon.execution.properties
        ├── com.kms.katalon.execution.webui.properties
        ├── com.kms.katalon.integration.analytics.properties
        └── com.kms.katalon.integration.qtest.properties

36 directories, 19 files

This seemed OK.

(3) I tried to renamed Test Cases/sub/subsub/TC1 to Test Cases/sub/subsub/Main. Then I got a error dialog, which said Unable to renamed the test case.

I looked at the folder tree:

$ tree .
.
├── Checkpoints
...
├── Scripts
│   └── sub
│       └── subsub
│           └── TC1
│               └── Script1675690524595.groovy
├── Test Cases
│   └── sub
│       └── subsub
│           └── Main.tc
...

Interesting enough.

  • Test Cases/sub/subsub/TC1.tc has been already renamed to Test Cases/sub/subsub/Main.tc;
  • but the Scripts/sub/subsub/TC1/*.groovy file was left un-renamed

Obviously you can see, the renaming operation partially failed.

A Test Case in Katalon Studio is implemented as a combination of 2 physical files: one in the Test Cases folder, another in the Scripts folder. When I tried renaming a Test Case, Katalon Studio renamed a file under the Test Cases folder, but failed to rename the counter-part under the Scripts folder. Katalon Studio is not capable of Transactinal processing.

What is “Transactinal processing”? Well, Wikipedia tells you: “Each transaction must succeed or fail as a complete unit; it can never be only partially complete.”

(4) I tried renaming the Test Cases/sub/subsub/TC1 again.

I coud rename it, but I found the new Test Cases/sub/sub/Main has the following code:

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

This is an initial code: what we usually find when we create a new Test Case.

$ tree .
.
├── Checkpoints
...
├── Scripts
│   └── sub
│       └── subsub
│           ├── Main
│           │   └── Script1675690919162.groovy
│           └── TC1
│               └── Script1675690524595.groovy
├── Test Cases
│   └── sub
│       └── subsub
│           └── Main.tc

You can find 2 files Scripts/sub/subsub/TC1 and Scripts/sub/subsub/Main.

I checked the content of Scripts/sub/subsub/TC1, which as as follows:

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.comment("Hello, I am TC1!")

Wow! My vanished code was still there!

@MarkBC

You reported your issue at Why does Katalon Studio randomly erase test cases? .

You may find your “seemingly vanished codes” still remain in the Scripts folder with the previous folder names. Please check your project folder tree.

You can not check the project folder tree accurately using Katalon Studio.

You need to use Windows Explorer, or Mac Finder, or Terminal.

Thanks for the suggestion. I did find the files (using Finder on my Mac) and they existed in the scripts directory, but were 0 bytes long.

@MarkBC

I am sorry to hear that the files were 0 bytes long. Anything may be caused by bugs.


In order to protect your resources from being erased by Katalon Studio in future, I would recommend you to use Git to make a local backup of your projects.

Git is really bug-free! You can trust it.

I have posted a new one about the same issue:

i hope yo realize that i can read this as:

  • katalon development suck, dont ever trust. use alternate solutions!

@vu.tran any opinnion on this?

1 Like

Hi everyone,

We apologize for the inconvenience. This bug should have been fixed in version 8.3.0 as you can see in the release note. Our team is looking into it and will keep you updated.

Thank you!

1 Like

Mhm … I cannot see any refference of this in the mentioned release notes.
I can only see:

Bug: Could not update test object references after renaming test objects

but this is a different animal. perhaps related … no idea.

Anyway, was not fixed in 8.3.0 as Kazurayam demoed.

  • macOS 12.6
  • Katalon Studio 8.3.0

Thank you for sharing this. We acknowledged the situation and as @Shin has mentioned, we are altering the solution and will keep all users informed.

I believe that if Git has any new bug, the whole IT world would stop today.

Or it will switch back to svn …

I would never go back to Svn, Cvs.

I demand to be able to make commits locally without network connection to the remote repository server.

This bug is resolved in 8.6
Thanks to our Community for finding this issue.

1 Like

Please check our newest release here [New Releases] Katalon Platform Updates - March 17th, 2023. Thank you everyone!