首页 > 解决方案 > karate.robot can be accessed in .java or js files/ Can java or Js code call feature files?

问题描述

I had the following questions:

  1. I want to use Karate. robot in Java or Js files, is there a way to use it? can the robot interface be extended?
  2. Calling a feature file from Java code is possible?

TIA.

标签: karate

解决方案


Yes to both questions.

  1. karate-robot is a Maven artifact. And here is an example. Sorry JS is not an option. Maybe yes, because of something called "Graal", but not officially supported, and you are welcome to experiment.

  2. You can call a feature file from Java: https://github.com/intuit/karate#invoking-feature-files-using-the-java-api


推荐阅读