GatlingSystem-akka.actor.default-dispatcher-2错误-运行空手道加特林测试时因'j.l.NullPointerException'崩溃

问题描述 投票:0回答:1

[当我尝试用空手道运行Gatling性能测试时,我在错误日志中得到以下内容。

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文件的外观:


            <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

这是我的scala文件:

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文件:

Feature: Gatling test

    Background: 
    * url 'https://regres.in'

    Scenario: Get api

        Given path '/api/users/2'
        When method GET
        Then status 200

我看过]中提供的解决方案>

Crashed with 'j.l.NullPointerException' when i try to run karate-gatling test reports

还有https://github.com/intuit/karate/issues/404

但是提供的解决方案也无济于事。

我正在将Windows 10与Eclipse版本一起使用:2019-09 R(4.13.0)。

我尝试运行另一个与项目相关的功能文件,但给出了相同的错误,因此在视频教程之后尝试进行简单测试-https://www.youtube.com/watch?v=RrRhndl-osY

有人可以帮忙吗?

[当我尝试用空手道运行Gatling性能测试时,我在错误日志中得到以下内容。模拟perf.SVTKarate模拟开始... 17:55:28.277 [GatlingSystem-akka.actor.default -...

karate
1个回答
0
投票

为了使面临此问题的其他人受益,解决方案是使pom.xml与相同版本的Karate保持一致。我的空手道得分为0.9.5.RC4,而空手道阿帕奇的得分为0.9.4。当我将它们都设置为0.9.5.RC4时,我没有遇到这些问题。确保pom.xml一致。

© www.soinside.com 2019 - 2024. All rights reserved.