Search code examples
scalagatlingscala-gatling

Gatling: How to solve "cannot find impicit parameter"?


I have this Gatling Simulation:

package package_name
import io.gatling.core.Predef._
import io.gatling.http.Predef._

class PerformanceTest extends Simulation {
  private val httpConfiguration = http
    .baseURL(Configuration.baseUrl)
    .acceptEncodingHeader("gzip, deflate")
    .userAgentHeader(Configuration.userAgentName)
    .inferHtmlResources()
    .maxConnectionsPerHostLikeChrome
    .disableClientSharing
    .extraInfoExtractor(dumpSessionOnFailure)
}

Where Configuration is a simple object Configuration { ... }.

Gatling won't compile the tests, stating this error message:

[...]\performance-test\src\gatling\scala\package_name\performance\test\PerformanceTest.scala: 
could not find implicit value for parameter configuration: io.gatling.core.config.GatlingConfiguration
  private val httpConfiguration = http
                                  ^
one error found

How can I solve this error?


Solution

  • The solution is as simple as frustrating: I changed the package name (not the location of the file) to performance_test (it was com.company.performance.test before). Now the code compiles flawlessly.