help with a query

Hi Guys
I need some help with a query , I'm trying to convert some of my tests
from soapui to gatling.

In Soap when I run my test this is the output
POST
http://XX.XX.XXX.XX:8062/job/JobData?job_source_file=e%3A%2F20111006170000_SID4703_EID1505_Modern_Family1.ts&job_priority=2&job_description=test&job_destination_file=e%3A%2FDone%2Fmodern_family_iphone&job_template_id=474&job_customer_id_list=<customer_id>-1<%2Fcustomer_id>%20%20
HTTP/1.1

Its basically posting this xml, to http://XX.XX.XXX.XX:8062/job
<JobData>
  <job_template_id>474</job_template_id>
  <job_source_file>e:/
20111006170000_SID4703_EID1505_Modern_Family1.ts</job_source_file>
  <job_destination_file>e:/Done/modern_family_iphone</
job_destination_file>
  <job_priority>2</job_priority>
  <job_description>GORDON Created via REST API</job_description>
  <job_customer_id_list> <customer_id>-1</customer_id> </
job_customer_id_list>
  <requested_node_guid />
</JobData>

Heres what I've tried in Gatling

val urlBase = "http://XX.XX.XXX.XX:8062"
val httpConf = httpConfig.baseURL(urlBase)

val scn = scenario("add new job")

  .exec(
  http("add_job")
  .post("/job/JobData")
  .queryParam("job_source_file","e:/blade_test.wmv")
  .queryParam("job_priority","2")
  .queryParam("job_description","test")
  .queryParam("job_destination_file","e:/Done/blade_test_iphone")
  .queryParam("job_template_id","474")
  .queryParam("job_customer_id_list","<customer_id>-1</customer_id>")
  )
val scnConf = scn.configure users 1 ramp 1 protocolConfig httpConf
runSimulation(scnConf)

It run and say success but I can see its not adding the job. I've
tried running gatling with DEBUG and INFO but getting no joy.

Thanks,
Gordon

Hi Gordon,

First, thanks for using Gatling :slight_smile:

Concerning your question, I think the best way for you is to use the body method instead of query parameters.

You can find documentation here : https://github.com/excilys/gatling/wiki/Gatling-HTTP#wiki-request-body

With this method, you can either send the content of a file (where you could put your XML body), or a String (representing your XML content).

Hope this helps!

Cheers,
Romain

Hi Gordon,

Soap UI is probably misleading you : sending a POST request to http://XX.XX.XXX.XX:8062/job/JobData?job_source_file=e%3A%2F20111006170000_SID4703_EID1505_Modern_Family1.ts&job_priority=2&job_description=test&job_destination_file=e%3A%2FDone%2Fmodern_family_iphone&job_template_id=474&job_customer_id_list=<customer_id>-1<%2Fcustomer_id>%20%20
HTTP/1.1 is completely different from sending a POST request with your XML.

If what you indeed want is posting your XML, Romain is right, you should use the request body template.

Please let us know if it works for you.
Cheers,

Stephane

2012/3/8 Romain Sertelon <bluepyth@gmail.com>

Brilliant that work perfectly and well done on gatling. Really
enjoying it so far :slight_smile:
For anyone who has same query here's how mu scenario looks now
val scn = scenario("add new job")

  .exec(
  http("add_job")
  .post("/job")
  .fileBody("postjob.xml").asXML
  )

Cool!
Have fun!

2012/3/8 Gordon Conroy <gordon_conroy@yahoo.com>

I’m glad that you like Gatling :wink:

Cheers,
Romain