当我尝试运行空手道测试报告时,崩溃了“ j.l.NullPointerException”

时间:2019-06-29 21:39:11

标签: scala karate gatling

我正在尝试使用karate.gatling项目获得一些加特林报告,但我总是会收到一些令人讨厌的错误。我正在使用karete版本0.9.3和gatling-olugin 3.0.1。任何我在做什么错的想法吗?

18:38:05.318 [GatlingSystem-akka.actor.default-dispatcher-5] ERROR c.intuit.karate.gatling.KarateAction - 'classpath:com.it.service/service.feature' crashed on session Session(hello,100,1561847885316,Map(),0,OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$320/1088104996@684a18c9), forwarding to the next one
java.lang.NullPointerException: null
        at com.intuit.karate.Resource.<init>(Resource.java:57)
        at com.intuit.karate.core.FeatureParser.parse(FeatureParser.java:75)
        at com.intuit.karate.FileUtils.parseFeatureAndCallTag(FileUtils.java:156)
        at com.intuit.karate.Runner.callAsync(Runner.java:187)
        at com.intuit.karate.gatling.KarateAction.execute(KarateAction.scala:66)
        at io.gatling.core.action.Action.$bang(Action.scala:38)
        at io.gatling.core.action.Action.$bang$(Action.scala:38)
        at com.intuit.karate.gatling.KarateAction.io$gatling$core$action$ChainableAction$$super$$bang(KarateAction.scala:27)
        at io.gatling.core.action.ChainableAction.$bang(Action.scala:63)
        at io.gatling.core.action.ChainableAction.$bang$(Action.scala:61)
        at com.intuit.karate.gatling.KarateAction.io$gatling$core$action$ExitableAction$$super$$bang(KarateAction.scala:27)
        at io.gatling.core.action.ExitableAction.$bang(BlockExit.scala:138)
        at io.gatling.core.action.ExitableAction.$bang$(BlockExit.scala:136)
        at com.intuit.karate.gatling.KarateAction.$bang(KarateAction.scala:27)
        at io.gatling.core.controller.inject.Workload.startUser(Workload.scala:55)
        at io.gatling.core.controller.inject.Workload.$anonfun$injectUser$1(Workload.scala:66)
        at akka.actor.Scheduler$$anon$4.run(Scheduler.scala:205)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
        at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

KarateSimulation

class KarateSimulation extends Simulation {

  val protocol = karateProtocol(
    "/say/{name}" -> Nil,
    "/service" -> pauseFor("get" -> 15, "post" -> 25)
  )

  val service = scenario("service").exec(karateFeature("classpath:com.it.service/service.feature"))

  setUp(
    service.inject(rampUsers(100) during (10 seconds)).protocols(protocol)
  )
}

service.feature

Feature: service

 Background:
    * url 'http://nelson-x510unr:8081'

    Scenario: service
      Given path 'service'
      When method get
      Then status 200

      Given path 'say/company'
      When method get
      Then status 200

1 个答案:

答案 0 :(得分:0)

如果您的Java安装需要进行故障排除,请查看此线程是否有帮助:https://github.com/intuit/karate/issues/404

否则,您需要帮助我们复制此问题,请遵循以下说明:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue