Error exporting test artifacts in Katalon Studio
When exporting test artifacts in Katalon Studio, the following error can occur:
Error exporting test artifacts
Cannot invoke "java.io.File.getAbsolutePath()" because the return value of "com.katalon.platform.api.model.TestCaseEntity.getScriptFile()" is null
Cause
Each test case in Katalon Studio should consist of:
- A metadata file (
.tc
, in XML format) - A script file (
.groovy
)
The error arises when one or more test cases are missing the script file (*.groovy
). This can happen due to merge conflicts, unexpected errors, or other issues that caused the file to be lost or corrupted.
Remedy
Identify the broken test case(s).The error occurs because Katalon Studio is trying to export a test case, but the script file (
*.groovy
) is missing. To identify the problematic test case(s), apply the binary search technique:a. Export half of the test case folders.
b. If the error occurs, narrow down the problem by exporting half of the previously selected folders.
c. If no error occurs, export the second half of the folders.
d. Repeat this process until you identify the folder containing the broken test case(s).
Once the broken test case(s) are identified, there are two ways to resolve the issue:
- Remove the test case
Completely delete both the metadata file (
*.tc
) and the script file (*.groovy
) for the broken test case.- Recreate the test case
Delete both the
*.tc
and*.groovy
files, and then recreate the test case using Katalon Studio