skip to Main Content

I’m attempting to build a series of gatling tests triggering karate scenarios. Changes I’m making to the feature file are only occasionally picked up by Gatling. For example, in the feature file code below, the first four items are run (including the commented out ‘relationships’ line):

Feature: This feature attempts to load the main tabs in sequence for the purposes of performance testing via gatling

    Background: Create the investigation and job first
      # Get api url from karate-config.js
      * url baseUrl
      # This configures the http headers to use admin user for running the tests
      * callonce read('classpath:common/headers/admin-headers.feature')

      * def investigaitonId = 150
      * def jobId = 51


  Scenario: Twitter investigation with 1 selector
    Given path 'investigations', investigaitonId
    When method get
    Then status 200

    Given path 'jobs', jobId
    When method get
    Then status 200

    Given path 'investigations', investigaitonId, 'actors'
    When method get
    Then status 200

    #Given path 'investigations', investigaitonId, 'relationships'
    #When method get
    #Then status 200

    Given path 'investigations', investigaitonId, 'entities'
    When method get
    Then status 200

    Given path 'investigations', investigaitonId, 'events'
    When method get
    Then status 200

    Given path 'investigations', investigaitonId, 'activities'
    When method get
    Then status 200

    Given path 'investigations', investigaitonId, 'activities-media'
    When method get
    Then status 200

The rest aren’t. See attached screen of run results:
enter image description here

POM for reference to the versions:

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.version>3.6.0</maven.compiler.version>
        <karate.version>0.9.4</karate.version>
        <junit5.version>5.5.1</junit5.version>
        <masterthought.version>4.9.0</masterthought.version>
        <gatling.plugin.version>3.0.2</gatling.plugin.version>
        <gatling.charts.version>3.2.1</gatling.charts.version>
        <scala.version>2.15.2</scala.version>
    </properties>

I suspect something like a compile file not refreshing or recompiling whenever a change is made.

2

Answers


  1. Chosen as BEST ANSWER

    This issue was resolved using the following command:

    mvn clean test-compile gatling:test
    

  2. You certainly have something missing in your pom.xml. Please compare your setup with this project: https://github.com/intuit/karate/tree/develop/examples/gatling

    If the *.feature files are not copied to the target/test-classes folder automatically – you will face this behavior.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search