'Unable to read file' error when using aShot plugin method to get difference ratio


I am trying to execute scripts through GitLab pipeline. In some scripts, I am using Image Comparison using aShot Keywords plugin’s “getDifferenceRatio” method. During script execution, I always encountered ‘can not read input file’ error at this point.

Absolute path of screenshot folder is /builds/qa/cim_automation_scripts/Screenshots
2023-07-10 07:54:19.332 INFO  com.kms.katalon.core.util.KeywordUtil    - Get diferences ratio of two images
2023-07-10 07:54:19.347 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ❌ Can't read input file!
2023-07-10 07:54:19.350 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/Unified_Agent_Scripts/Web_Chat_Scripts/VerifyTheChannelTypelnChatNotification(CIM-1214) FAILED.
com.kms.katalon.core.exception.StepFailedException: Can't read input file!

Executg same scripts on local machine never mentioned this issue which suspect it could be a permission related issue in gitlab environment. But which permissions???

I am not able to figure out what is the root cause of this issue and if it is related to some permission problem then which permission do I need to look for successfull execution of this method.

Any help would be much appreciated.


1 Like
Absolute path of screenshot folder is /builds/qa/cim_automation_scripts/Screenshots
... Can't read input file!

Are you sure that the “/build/qa/cim_automation_scripts/Screenshots” is an approriate path to a folder which is present in the runtime environment? I doubt it.

The path is OK because it is getting through the File method


Later, I figured out the issue which was due to my non-sense. On windows, the path seperator is \ but on Unix, it accepts / as path seperator. I was passing windows path seperator \ while executing scripts on Unix so that’s why getting this error. Later, I modfied the line where I building the directory path with


to make it dynamic as per the OS where scripts are running.

I edited your post slightly

In your original post, a back slash \ was regarded a special character: a part of escape sequence. So when you write

On windows, the path separator is '\'

It was rendered by Discourse as

On windows, the path separator is ''

This just confuses readers.

Originally you wrote

I changed this to

On windows, the path seperator is `\`

I changed a single quote character ' to a back quote (or accent grave) character ` so that a string quoted by a pair of back quote characters is NOT escaped.

This forum.katalon.com site is powered by Discourse. You can find a manual of markdown of Discourse here