-1

A bit frustrated that can't make this work, as it is simply documented on this link https://github.com/karatelabs/karate#calling-java

Tried to create from scratch using maven archetype and the standalone jar just to make sure its not about folder structure. Please see below screenshots:

Maven Archetype Standalone Jar

Update: It works after removing .java in the parameter value.

instead of * def helper = Java.type('examples.users.Helper.java') changed it to * def helper = Java.type('examples.users.Helper')

But only works when run as cucumber feature from eclipse. Still cant make it work in vscode.

enter image description here

Don
  • 163
  • 12
  • Also created a chat room for anyone who also use this testing framework by Peter. https://chat.stackoverflow.com/rooms/info/243557/karate-testing – Don Apr 03 '22 at 13:56
  • sorry, screenshots don't help at all: https://stackoverflow.com/help/how-to-ask - my only advice is to follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue – Peter Thomas Apr 03 '22 at 14:53
  • Just to give an update @PeterThomas. I've created an issue on karate-runner github. https://github.com/kirksl/karate-runner/issues/138. Waiting for Kirk response. – Don Apr 17 '22 at 19:10
  • these are open-source projects. using java in a non-maven project may need some extra settings. we urge you to also investigate and contribute your findings back to the community – Peter Thomas Apr 18 '22 at 04:17

1 Answers1

1

It works after removing .java in the parameter value.

instead of 
* def helper = Java.type('examples.users.Helper.java') 

changed it to 
* def helper = Java.type('examples.users.Helper')
Don
  • 163
  • 12