Test Case loses its code when moved over another Test Case with the same name

I used Katalon Studio v10.3.2 on macOS 15.6.1

Problem to solve

I often make sub folders in the Test Cases tree to locate my test cases.

I do change the name of my testcases. I do change the name of sub folders.

I even move my testcases from a folder to another.

I repeat such “refactoring” to seak for the best state of the Test Cases tree.

During this refactoring, I encountered a serious defect of Katalon Studio.

step1

Initially, I had a testcase Test Cases/main/TC1. The code was as follows:


import com.kms.katalon.core.util.KeywordUtil

def v = new Date().getTime()
if (v % 2 != 0) {
    KeywordUtil.markFailed("${v} is not even")
} else {
    KeywordUtil.logInfo("${v} is even")
}

Random rand = new Random()
Thread.sleep(rand.nextInt(999))

step1

step2

I copied the Test Cases/main/TC1 to make another testcase Test Cases/TC1.

step2

I did a copy operation manually on the Katalon GUI. I right-clicked over Test Cases/main/TC1 and selected the “Copy” menu. Then I left-clicked the Test Cases folder, right-click it, chose the “Paste” menu. I got a new test case Test Cases/TC1. It contained the same code as the Test Cases/main/TC1.

This step worked fine.

step3

I moved the Test Cases/main/TC1 into the ancestor folder Test Cases. I left-clicked the Test Cases/main/TC1 and drag it onto the Test Cases folder. This operation resulted a name collision. The Test Cases folder can not hold two TC1 instances. Therefore Katalon Studio created a new test case named Test Cases/TC1 (1), which corresponds to the previous Test Cases/main/TC1. Now the Test Cases/main folder contains no testcases.

step3

I checked the content of the new Test Cases/TC1 (1) file. It looked as follows:

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 too bad. I lost my code of the previous Test Cases/main/TC1 testcase.

You may think that this is a small point. No, this is serious. This defect makes me feel Katalon Studio is unreliable. I will hesitate in Katalon Studio to do any refactoring which is essential for quality software development.

Solution

Katalon,

Please fix this bug.

Katalon Studio must not throw the valuable code away!

3 Likes

Dear Mr Kazu,

Thanks for the clear steps :exploding_head: I’ve passed this straight to the team. We’re looking into it now. I’ll update this thread as soon as I hear back. :blue_heart:

Hi @kazurayam,

Thank you for letting us know this issue. I’m not sure if it’s my side’s problem but I can’t see the images loaded. Can you please help re-upload the images so that I can create the ticket for our team? Thank you

1 Like

I can see the snapshots , probably something wrong at your end

1 Like

You can get the images at:

I have encountered a similar related bug. Sometimes if I simply rename a test case it can lose all of it’s content (the test steps). This has happened often enough that I dare not rename any test case without making a copy first (checking the copy has steps) then rename the original and check again that has not lost ant steps. The whole process make Katalon a pain to use at times and does not inspire me with confidence in the product.

I feel sorry for you, but I am not surprised.

I know, Katalon Studio has more bugs around renaming/moving TestCases. See the following topic dated at Feb 2023, which is still open.

1 Like

I have faced similar issues when cloning (coping/pasting) test cases and also moving them to different folders.

The way i found that works better, is closing the test case windows I want to move/copy. I think that it should be related with the displayed windows instance in the IDE.

1 Like

Could you write down a step-by-step procedure to reproduce the incident you got? If you could make it, Katalon should be able to fix it.

I think it is quite likely.

1 Like

See the following topic for more detail:

1 Like