Gatling - Taurus querying results

2/5/2019

I am running Gatling through Taurus querying some REST endpoints using the following yaml configuration

execution:
- executor: gatling
concurrency: 1
hold-for: 30s
ramp-up: 3s
scenario: Thread Group

scenarios:
  Thread Group:
   requests:
    - label: demo
    method: GET
    url: https://Cname/health
    assert:
    - contains:
      - “healthy”
      subject: body
      regexp: true
      not: true

And it is returning 200 for all tests - Yay! However when I replace "healthy" with "someText" it is still returning 200 :( . I suspect that it is not executing the assert condition and merely verifying that there is an endpoint. Any insight would be appreciated ?

-- Steve
gatling
kubernetes
taurus

1 Answer

2/6/2019

Right the answer involved writing a separate script that contains a scenario. This can be injected in to the code to query the response , as below .

  val scn = scenario("check return details") 
    .exec(http("check the actual return ") 
      .get("urlLocation") 
         .check(jsonPath("$.friendlyName").is("testName"))) 
-- Steve
Source: StackOverflow