I am only using the latest standalone karate jar to test my API on a docker container configured with JRE and I don't have any Java code.
Currently on one of my features, i have this : read('file.json')
,
and it works fine when the resource file is on the same directory than the feature file. I know that it is recommended to do this way.
But if i also want to have a central directory with all resource files to avoid duplicatas,
it doesn't work even with this command :
read('classpath:directory/file.json')
The error is the following :
"[com.intuit.karate.exception.KarateException: could not find or read file: xxx, prefix: CLASSPATH"
I even tried without success to set a classpath on the command line when running the jar :
java -cp $CLASSPATH . -jar ~/karate.jar
My question: Is it possible to set a Prefix on Karate with the standalone jar to be able to easily read any file from other directories ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…