How to Load XML File in Gatling

Hi,

I was trying to load an XML file in scala codes to get the configurations needed to set the Scenarios.
However, no matter how i try, my Simulation class is not able to find the xml file.
I need to specific absolute path which is not what i want.
How can i specify relative path to get the xml file?

val suitesXml = XML.load(“scenario_suites.xml”)
val nodes = (suitesXml \ “suites” \ “suite”)

The path directory
target->
test-classes->
xxx.xxx.xxx packages->
MySimulationClass.scala

data->
feeders.csv
scenaro_suites.xml

pom.xml
src/test/resources/data
src/test/scala
target/gatling/results

Have you tried ‘data/scenario_suites.xml’. You can set data and requestBodies paths in gatling.conf.

See https://github.com/gatling/gatling/blob/v2.1.4/gatling-core/src/main/scala/io/gatling/core/config/GatlingFiles.scala#L38

Beware, this code will change in Gatling 2.2.

Thanks Stéphane