如何解决空手道中“不允许访问主机类或不存在”的问题

问题描述 投票:0回答:2

有点沮丧,无法完成这项工作,因为它只是在此链接上记录了https://github.com/karatelabs/karate#calling-java

尝试使用 Maven 原型和独立 jar 从头开始创建,只是为了确保它与文件夹结构无关。请看下面的截图:

更新: 去掉参数值中的.java后就可以了。

而不是

* def helper = Java.type('examples.users.Helper.java')
改成
* def helper = Java.type('examples.users.Helper')

但仅当从 Eclipse 作为 Cucumber 功能运行时才有效。 还是无法在 vscode 中运行。

karate java-interop
2个回答
1
投票

去掉参数值中的.java后就可以了。

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

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

0
投票

您是如何解决 VS Code 中的此错误的?我看到同样的错误

  • def helper = Java.type('examples.users.Helper')
© www.soinside.com 2019 - 2024. All rights reserved.