• Post Reply Bookmark Topic Watch Topic
  • New Topic

increment a soap request's element for load test

 
Aayush Singhal
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've got a sample request like this :

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:imp="http://impls.www.aayush.com" xmlns:xsd="http://aayush.com/xsd">
<soap:Header/>
<soap:Body>
<imp:createCustomer>
<!--Optional:-->
<imp:request>
<!--Optional:-->
<xsd:custref>LoadTest1</xsd:custref>
</imp:request>
</imp:createCustomer>
</soap:Body>
</soap:Envelope>

Now I want to run a load test on this request using a different custRef everytime (this custRef is stored in a database so cannot be the same). How can i increment 'custRef' after every step so that the value is LoadTest1, LoadTest2, LoadTest3 etc??

Thanks in advance.
 
Ravinderjit Singh
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add groovy script step to generate this.
 
Aayush Singhal
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ravinderjit for the reply.

But i couldn't understand how to transfer the properties through groovy script.

I tried to add the inline script ${System.currentTimeMillis()} in the custRef element but it send "" (blank string) in the request...
 
Ravinderjit Singh
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what you should add in your groovy script.


Then add step 'Property Transfer' where you can easily transfer the result of groovy script to next step's request.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!