空手道 API:从其他文件夹调用功能文件时找不到文件异常

Karate API : File not found exception while calling a feature file from other folder

如果调用功能文件存在其他包,则获取文件未找到错误 Test.feature 在 Folder1 中,我在 Folder2 的另一个功能文件中 如下所示

    * def res = call read('Test.feature')

获取错误

   - javascript evaluation failed: read('Test.feature')

如果我将 Test.feature 文件放入 Folder2 并且 运行 它工作正常。

即使我尝试使用如下类路径调用 callonce,但仍然遇到相同的错误文件未找到。

   * def res= call read('classpath:Test.feature')

使用最新版本的空手道

您以前从未使用过相对路径吗?

* def res = call read('../Folder1/Test.feature')

但即使使用 classpath,您还是忘记指出它所在的文件夹:

* def res = call read('classpath:Folder1/Test.feature')