How to Load XML File in Gatling

679 views
Skip to first unread message

Kenny

unread,
Apr 7, 2015, 5:56:25 AM4/7/15
to gat...@googlegroups.com
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
<dataFolder>src/test/resources/data</dataFolder>
<simulationsFolder>src/test/scala</simulationsFolder>
<resultsFolder>target/gatling/results</resultsFolder>


 

  

empty account

unread,
Apr 7, 2015, 9:48:09 AM4/7/15
to gat...@googlegroups.com
Have you tried 'data/scenario_suites.xml'. You can set data and requestBodies paths in gatling.conf.

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stéphane LANDELLE

unread,
Apr 7, 2015, 10:14:26 AM4/7/15
to gat...@googlegroups.com

Kenny

unread,
Apr 15, 2015, 6:41:40 AM4/15/15
to gat...@googlegroups.com
Thanks Stéphane
Reply all
Reply to author
Forward
0 new messages