GatlingSystem-akka.actor.default-dispatcher-2错误-运行空手道加特林测试时因'j.l.NullPointerException'崩溃 [英] GatlingSystem-akka.actor.default-dispatcher-2 error - crashed with 'j.l.NullPointerException' when running Karate Gatling test
问题描述
当我尝试用空手道运行Gatling性能测试时,我在错误日志中得到以下内容.
When I try to run a Gatling performance test with Karate, I get the following in the error log.
Simulation perf.SVTKarateSimulation started...
17:55:28.277 [GatlingSystem-akka.actor.default-dispatcher-2][ERROR][Action.scala:71] c.i.k.g.KarateAction - 'classpath:com/TCEU/KarateTests/Test.feature' crashed with 'j.l.NullPointerException', forwarding to the next one
这是我的pom文件的外观:
This is how my pom file looks:
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>3.0.4</version>
<configuration>
<simulationsFolder>src/test/java</simulationsFolder>
<includes>
<include>perf.SVTKarateSimulation</include>
</includes>
<jvmArgs>
<jvmArg>-Dfile.encoding=UTF-8</jvmArg>
</jvmArgs>
</configuration>
</plugin>
并使用Karate-Gatling 0.9.5.RC4
And using Karate-Gatling 0.9.5.RC4
这是我的scala文件:
This is how my scala file:
package perf
import com.intuit.karate.gatling.PreDef._
import io.gatling.core.Predef._
import scala.concurrent.duration._
import io.gatling.http.Predef._
class SVTKarateSimulation extends Simulation {
val create = scenario("Get api").exec(karateFeature("classpath:com/TCEU/KarateTests/test.feature"))
setUp(
create.inject(rampUsers(10) during (10 seconds)))
}
还有test.feature文件:
And the test.feature file:
Feature: Gatling test
Background:
* url 'https://regres.in'
Scenario: Get api
Given path '/api/users/2'
When method GET
Then status 200
我查看了
崩溃为"jlNullPointerException",当我尝试运行空手道加特林测试报告时
以及 https://github.com/intuit/karate/issues/404
但是其中提供的解决方案也无济于事.
But the solutions provided in that does not help either.
我正在使用Windows 10和Eclipse版本:2019-09 R(4.13.0).
I am using Windows 10 with Eclipse Version: 2019-09 R (4.13.0).
我尝试运行另一个与项目相关的功能文件,但给出了相同的错误,因此在视频教程之后尝试了一个简单的测试-
I tried to run another project related feature file but that gave the same error so tried a simple test following a video tutorial - https://www.youtube.com/watch?v=RrRhndl-osY
有人可以帮忙吗?
推荐答案
对于其他面临此问题的人来说,解决方案是使pom.xml与相同版本的Karate保持一致.我的空手道得分为0.9.5.RC4,而空手道阿帕奇的得分为0.9.4.当我将它们都设置为0.9.5.RC4时,我没有遇到这些问题.确保pom.xml一致.
For the benefit of anyone else who faces this issue, the solution is to keep your pom.xml consistent with same version of Karate. My karate-gatling was 0.9.5.RC4 where as karate-apache was 0.9.4. When I made them both 0.9.5.RC4, I did not face these issues. Make sure pom.xml is consistent.
这篇关于GatlingSystem-akka.actor.default-dispatcher-2错误-运行空手道加特林测试时因'j.l.NullPointerException'崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!