V8.3.0beta; script code vanished when test case is renamed

Katalon Studio v8.3.0.beta
macOS Monterey 12.2.1

I created a GitHub project where you can see the bug reproduced.

  • step1 I created a script Test Case/sub/TC1, this had no problem
  • step2 I moved the script to Test Cases/sub/subsub/TC1, this had no problem
  • step3 I renamed the script to Test Cases/sub/subsub/Main
  • step4 I renamed the script to Test Cases/sub/subsub/Test, Test Cases/sub/subsub/TestTest, Test Cases/sub/subsub/testesttest ---- and found that the script code has vanished.

The GitHub repository has 4 tags, so you can trace what I did.

I looked at the 2 folders <projectDir>Test Cases and <projectDir>/Script and found that 2 folders has become inconsistent.

I looked at the Katalon’s .log file, where I found a StackTrace:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2022-03-02 20:55:53.947
!MESSAGE 
!STACK 1
org.eclipse.core.internal.resources.ResourceException(/%Users%kazuakiurayama%katalon-workspace%CodeVanishedWhenTestCaseRenamed%CodeVanishedWhenTestCaseRenamed.prj/Scripts/sub/subsub/TestTest/Script1646222137979.groovy)[368]: java.lang.Exception: File not found: /Users/kazuakiurayama/katalon-workspace/CodeVanishedWhenTestCaseRenamed/Scripts/sub/subsub/TestTest/Script1646222137979.groovy.
	at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:835)
	at org.eclipse.core.internal.resources.File.getContents(File.java:275)
	at org.eclipse.core.internal.resources.File.getContents(File.java:266)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.getScriptContent(TestArtifactScriptRefactor.java:208)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.replace(TestArtifactScriptRefactor.java:159)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferences(TestArtifactScriptRefactor.java:281)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForTestCaseFolder(TestArtifactScriptRefactor.java:261)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForProject(TestArtifactScriptRefactor.java:247)
	at com.kms.katalon.dal.fileservice.manager.TestCaseFileServiceManager.updateTestCase(TestCaseFileServiceManager.java:131)
	at com.kms.katalon.dal.fileservice.dataprovider.TestCaseFileServiceDataProvider.updateTestCase(TestCaseFileServiceDataProvider.java:27)
	at com.kms.katalon.controller.TestCaseController.updateTestCase(TestCaseController.java:126)
	at com.kms.katalon.composer.testcase.handlers.RenameTestCaseHandler$2.run(RenameTestCaseHandler.java:83)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
!SUBENTRY 1 org.eclipse.core.resources 4 368 2022-03-02 20:55:53.947
!MESSAGE File not found: /Users/kazuakiurayama/katalon-workspace/CodeVanishedWhenTestCaseRenamed/Scripts/sub/subsub/TestTest/Script1646222137979.groovy.
!STACK 0
java.lang.Exception: File not found: /Users/kazuakiurayama/katalon-workspace/CodeVanishedWhenTestCaseRenamed/Scripts/sub/subsub/TestTest/Script1646222137979.groovy.
	at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:835)
	at org.eclipse.core.internal.resources.File.getContents(File.java:275)
	at org.eclipse.core.internal.resources.File.getContents(File.java:266)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.getScriptContent(TestArtifactScriptRefactor.java:208)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.replace(TestArtifactScriptRefactor.java:159)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferences(TestArtifactScriptRefactor.java:281)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForTestCaseFolder(TestArtifactScriptRefactor.java:261)
	at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForProject(TestArtifactScriptRefactor.java:247)
	at com.kms.katalon.dal.fileservice.manager.TestCaseFileServiceManager.updateTestCase(TestCaseFileServiceManager.java:131)
	at com.kms.katalon.dal.fileservice.dataprovider.TestCaseFileServiceDataProvider.updateTestCase(TestCaseFileServiceDataProvider.java:27)
	at com.kms.katalon.controller.TestCaseController.updateTestCase(TestCaseController.java:126)
	at com.kms.katalon.composer.testcase.handlers.RenameTestCaseHandler$2.run(RenameTestCaseHandler.java:83)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Conclusion

This bug has a fatal impact. This looks too silly.

I suppose that the v8.3.0 must not be released before this issue is fixed.

Otherwise I am afraid you would lose many customers.

@Jass
@duyluong


Appendix 25 May 2022

I looked the above sample project directory at the state of step4.

A Katalon Project has <projectDir>/Test Cases folder and <projectDir>/Scripts folder. Theoretically these 2 folders should be always in sync. However at the step4, the Scripts folder is corructed. See the following screenshot.

There is Scripts/sub/TestTest folder; but there is not Test Cases/sub/TestTest.tc file. This must be a falt.

~/katalon-workspace/CodeVanishedWhenTestCaseRenamed $ tree Scripts
Scripts
`-- sub
    |-- TestTest
    |   `-- Script1646222137979.groovy
    `-- testesttest
        `-- Script1653476524706.groovy

I looked at the files under the Scripts folder. See the following screenshot.

  • Scripts/sub/testesttest/Script1653476524706.groovy file is effectively empty.
  • The Scripts/sub/TestTest/Script1646222137979.groovy file contains the code I wrote.

I expected the Script/sub/testesttest/Script*.groovy to keep the code I wrote, and I expected there remains not TestTest/Script*.groovy. ---- These did not happened.

I see this is a bug of Katalon Studio.

1 Like

I noticed that V8.2.5 has the same problem.

@kazurayam: For a serial of actions with rename and moving, before moving/rename it, please help to close the test test case, refresh the project. System works fine after that.

Could you please help to try again and let us know the result after refresh project

image

Note: Like other system, we users have a serial actions to the source data, refresh is required for next actions, example : Solr search engine.

Hope this information is useful.

No I won’t.

I would refuse your advice.

Hi @kazurayam

Thanks for reporting this bug. It is a regression bug reported by some other users as well. We’ll consider fixing it.

Happy Testing
Jass

I have never seen such fragility in IntelliJ IDEA.

I would never compare a GUI software like KS with a text search engine like Lucene.

Thanks @Jass,

Hope to see the issue fixed soon

FYI.

This bug still persists in the v8.3.0.

Carelessly enough, I renamed a test case script. And once renamed, my code in the test case script went away!

I regret that I forgot adding and committing the test case script into the local Git repository before renaming it.

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.