首页 > 解决方案 > Can we call other TestRunner file in the karate feature file

问题描述

trying to call other test runner class (basically its is TestNG file) in the karate feature file. Feature:


  Background:
    * def processRequest = Java.type('com.walmart.testrunnerclass.processRequest')

    Scenario:
      Given processRequest.feature 

is this the right way of calling. also is there any keywords that needs to be used?

thanks

标签: karate

解决方案


If you mean using a Java class, you can, see the docs: https://github.com/intuit/karate#calling-java

* def JavaDemo = Java.type('com.mycompany.JavaDemo')
* def result = JavaDemo.doWorkStatic('world')

推荐阅读