English 中文(简体)
在操作过程中使用无证 h吗?
原标题:Using undocumented hook possible within runs?
  • 时间:2024-01-03 22:48:33
  •  标签:
  • karate

I see that there is a afterstep function within the hooks code, but when I try to utilize it within karate.configure, I get an error.

* karate.configure( afterStep , function(){ karate.call( classpath:adapters/splunklink-updated.feature ); })
js failed:
>>>>
01: karate.configure( afterStep , function(){ karate.call( classpath:adapters/splunklink-updated.feature ); })
<<<<
org.graalvm.polyglot.PolyglotException: unexpected  configure  key:  afterStep 
- com.intuit.karate.core.Config.configure(Config.java:334)
- com.intuit.karate.core.ScenarioEngine.configure(ScenarioEngine.java:348)
- com.intuit.karate.core.ScenarioBridge.configure(ScenarioBridge.java:300)
- <js>.:program(Unnamed:1)

Other hooks we would like to use as well

    default void beforeSuite(Suite suite) {

    }

    default void afterSuite(Suite suite) {
        
    }

    default boolean beforeStep(Step step, ScenarioRuntime sr) {
        return true;
    }

    default void afterStep(StepResult result, ScenarioRuntime sr) {
        
    }

    default void beforeHttpCall(HttpRequest request, ScenarioRuntime sr) {
        
    }
    
    default void afterHttpCall(HttpRequest request, Response response, ScenarioRuntime sr) {
        
    }
问题回答

无<编码> 页: 1 也许,你会将此与RuntimeHook混为一谈。





相关问题
How do I get karate-gatling example project to compile?

I downloaded the karate-gatling example project from here: https://github.com/karatelabs/karate/tree/master/karate-gatling I opened the project in IntelliJ and ran the following command: mvn clean ...

Reading Data with from csv file in Karate

Below is the data, I have maintained in the csv file Data "[{ label : Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into ...

Conditional logic for Karate UI

I am trying to add a conditional logic for karate UI feature that I am trying to build. The requirement is this: There are 5 fields; select(‘select[id=currency]’, ‘EUR’) // has a random logic to ...

热门标签