user1079925
user1079925

Reputation: 541

Gatling Performance - flushHttpCache

New to Gatling and trying to understand how to get "exec(flushHttpCache)" incorporated into my script as I am trying to stop redirects from occurring as these will skew my results.

I have:

 val getStartPage = feed(feeder).exec(http("Test start page (start-page)")
.exec(flushHttpCache) // <- this fails on compile "flushHttpCache is not a member of io.gatling.http.request.builder.Http"
.get("/start-page?id=${userId}")
.check(status.is(200))
.check(regex("Start now").exists))
.pause(longPause)

then:

   class myPerformanceTest extends Simulation with HttpConfiguration
   {
    val happyPath = scenario("testUsers")
                .exec(getStartPage)

   setUp(
     happyPath.inject(atOnceUsers(1))
          ).protocols(httpconf)

    }

I tried moving ".exec(flushHttpCache)" to: val happyPath = scenario("testUsers").exec(flushHttpCache) still no luck.

How do I incorporate the "flushHttpCache" into a script?

Any help appreciated

Upvotes: 0

Views: 474

Answers (1)

bojan
bojan

Reputation: 1

You should import

import io.gatling.http.Predef._

not

import io.gatling.http.request.builder.Http

The second part of question will work as you tried, with this import.

Upvotes: 0

Related Questions