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.
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.