无法在空手道功能文件中找到或读取文件

could not find or read file in karate feature file

当我尝试读取 json 或 js 文件时出现错误


could not find or read file

function() {
    
      return { 
          Authorization: "Bearer 32635fe69a7033023f82aa9d8c5bc8dd",
          "X-Account" : "7ad93b7d-714a-4f70-82ef-92de407f0245"
   
  }
}
  

a.json
   {
    "Authorization" : "Bearer 32635fe69a7033023f82aa9d8c5bc8dd",
    "X-Account" : "7ad93b7d-714a-4f70-82ef-92de407f0245"
}

根据您提供的任何信息,我真的无法理解。这肯定是您犯的一些简单错误,没有其他人报告过类似的错误。

我建议您使用 maven 原型创建一个新项目:https://github.com/intuit/karate#quickstart

然后使用那个 pom.xml 和项目框架作为基础,让事情开始运作。

编辑:我还认为问题可能是 X-Account 需要在这样的引号内:"X-Account" - 请注意 - 是 [=23= 的无效字符] 键(因为它将被视为减号)。