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

2024-03-07

当我尝试使用空手道运行加特林性能测试时,我在错误日志中收到以下内容。

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>    

并使用空手道加特林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

我查看了中提供的解决方案

当我尝试运行空手道加特林测试报告时,因“j.l.NullPointerException”而崩溃 https://stackoverflow.com/questions/56821029/crashed-with-j-l-nullpointerexception-when-i-try-to-run-karate-gatling-test-re

并且https://github.com/intuit/karate/issues/404 https://github.com/intuit/karate/issues/404

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

我使用的是 Windows 10 和 Eclipse 版本:2019-09 R (4.13.0)。

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

有人可以帮忙吗?


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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

GablingSystem-akka.actor.default-dispatcher-2 错误 - 运行空手道加特林测试时因“j.l.NullPointerException”而崩溃 的相关文章

随机推荐