Closed visasimbu closed 2 years ago
@visasimbu for anyone to help you, a working example is required. please re-read this and follow the instructions exactly as presented: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue
the only way we support re-use of feature files from a different "project" is a) via the classpath
and b) via java artifacts (typically JAR files). it does require advanced knowledge of Karate and perhaps there is scope for more contributions to open-source. I'm afraid I can't help more than this.
maybe you can read these discussions that may help:
https://stackoverflow.com/a/58339662/143475 https://stackoverflow.com/a/56553194/143475
If those don't help, please assume that what you are asking for is not supported by Karate. It certainly is not a priority for the project developers.
I have 2000 repos in my bitbucket which is segregated on 10 projects. Each repo has code which is written in IBM Integration bus/ACE. Means it is not Java application. This will expose a API. We plan to use Karate framework as our continuous testing in Jenkins pipeline.
So I have created one Java project with Runner Java class for POC. This worked!
With the plan of keeping this Karate framework Java project in separate repo. Maintaining all the feature files of 2000 in another separate repo for feature file maintainability.
When I try to pass the feature file from external drive like
return Karate.run("file:D:\\some\\path\\sometest.feature");
it fails with error message saying
"java.nio.file.InvalidPathExceptino: IIlegal char <:> at index 4: file:D:\some\path\sometest.feature" ...
Is it possible to call the feature files which is reside outside of Java project ? Please help me on this.
I have tried below 2 options to fix the problem.
1) I tried to use the Runner by using below snippet. This also returns exacts same error.
"Exception in thread main java.lang.NoClassDefFoundError: org/sl4j/LoggerFactory ..."
It seems it was expecting its dependecy of slf4j. How can I download all its dependencies and execute standalone JAR.