问题
I am trying to get some gatling report using karate.gatling project, but i always get the fallowing error. I am using karete version 0.9.3 and gatling-olugin 3.0.1. any idea of what i am doing wrong?
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:
See if this thread helps, in case your Java install needs troubleshooting: https://github.com/intuit/karate/issues/404
Else you have to help us replicate this problem, follow these instructions: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
来源:https://stackoverflow.com/questions/56821029/crashed-with-j-l-nullpointerexception-when-i-try-to-run-karate-gatling-test-re