This post follows my previous post:
I believe that I have found out a procedure how to reproduce the incident (Test Case code is erased by Katalon Studio). So I would explain it here.
I used 2 machine environments. The issue was reproduced on both.
- MacOS12.6 + Katalon Studio 8.3.0
- Windows 10 + Katalon Studio Standard Editon 8.4.1
I did:
-
Create a new Katalon Project
-
Create a new Test Case at
Test Cases/sub/subsub/TC1
. The code is just skeltal as follows:
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
WebUI.comment("Hello, world!")
- The file tree looked as follows.
.
βββ 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
β βββ Script1675984340226.groovy
βββ Test Cases
β βββ sub
β βββ subsub
β βββ TC1.tc
βββ Test Listeners
β βββ TL1.groovy
βββ Test Suites
β βββ TS1.groovy
β βββ TS1.ts
βββ TestScritVanishesWhenRenamed.prj
βββ bin
β βββ groovy
β βββ keyword
β βββ lib
β β βββ CustomKeywords.class
β β βββ internal
β β βββ GlobalVariable.class
β βββ listener
β β βββ TL1.class
β βββ 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.composer.testcase.settings.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, 24 files
This looked fine.
- I moved the Test Case from
Test Cases/sub/subsub/TC1
toTest Cases/sub/TC1
. I did it in the GUI by mouse click + drag + drop operation. The file tree looked as follows:
.
βββ Checkpoints
...
βββ Scripts
β βββ sub
β βββ TC1
β β βββ Script1675984340226.groovy
β βββ subsub
βββ Test Cases
β βββ sub
β βββ TC1.tc
β βββ subsub
...
So far, so good.
- In Katalon Studio GUI, I tried to rename
Test Cases/sub/TC1
toTest Cases/sub/Main
. I got an Error dialog.
After the error, the file tree looked as follows:
.
βββ Checkpoints
...
βββ Scripts
β βββ sub
β βββ TC1
β β βββ Script1675984340226.groovy
β βββ subsub
βββ Test Cases
β βββ sub
β βββ Main.tc
β βββ subsub
...
It is broken. No longer consistent.
I looked into the .log
file where I found an StackTrace was recorded
!ENTRY org.eclipse.e4.ui.workbench 4 0 2023-02-10 08:21:38.401
!MESSAGE
!STACK 1
org.eclipse.core.internal.resources.ResourceException(/%Users%kazurayam%tmp%TestScritVanishesWhenRenamed%TestScritVanishesWhenRenamed.prj/Scripts/sub/subsub/TC1/Script1675984340226.groovy)[368]: java.lang.Exception: File not found: /Users/kazurayam/tmp/TestScritVanishesWhenRenamed/Scripts/sub/subsub/TC1/Script1675984340226.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:206)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.replace(TestArtifactScriptRefactor.java:158)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferences(TestArtifactScriptRefactor.java:289)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForTestCaseFolder(TestArtifactScriptRefactor.java:260)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForProject(TestArtifactScriptRefactor.java:245)
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:132)
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 2023-02-10 08:21:38.402
!MESSAGE File not found: /Users/kazurayam/tmp/TestScritVanishesWhenRenamed/Scripts/sub/subsub/TC1/Script1675984340226.groovy.
!STACK 0
java.lang.Exception: File not found: /Users/kazurayam/tmp/TestScritVanishesWhenRenamed/Scripts/sub/subsub/TC1/Script1675984340226.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:206)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.replace(TestArtifactScriptRefactor.java:158)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferences(TestArtifactScriptRefactor.java:289)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForTestCaseFolder(TestArtifactScriptRefactor.java:260)
at com.kms.katalon.groovy.reference.TestArtifactScriptRefactor.updateReferenceForProject(TestArtifactScriptRefactor.java:245)
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:132)
at com.kms.katalon.composer.testcase.handlers.RenameTestCaseHandler$2.run(RenameTestCaseHandler.java:83)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
The problem was reproduced.