'How to get property from application.property in Gatling

I'm trying to get some properties from an application.properties file in Gatling-Scala. I tried.

val properties: Config = ConfigFactory.load("application.properties")
val clientId: String = properties.getString("api.clientId")

I keep getting "com.typesafe.config.ConfigException$Missing No configuration setting found for key 'api'". I put the application.properties file inside src/test/resources/application.properties and also in the root folder of the project. I tried also to put the same information inside src/test/resources/gatling.conf as follows:

gatling {
  api {
    clientId = "..."
  }
}

But I get the error:

com.typesafe.config.ConfigException$Missing No configuration setting found for key 'gatling' 

Is there something I'm missing?



Solution 1:[1]

I managed to get the information in the gatling.conf file by installing the plugin HOCON for .conf files and formatting it correctly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ouflak