Forum Discussion

mehmetemin's avatar
16 years ago

How can I set a variable ?

Hi all,

I will perform load and performans tests. There are scenarios, such as creating 100 user profiles, but I have a XML to create only one user. How can I set a variable in XML for user numbers and is there a way to increment this variable in evey create request?

Kind regards,
Mehmet.
  • Hi Mehmet,


    One way to do it is using properties and simulate a loop with a counter that would be implemented using property expansion, Groovy script and a conditional goto.

    Define a property for your test suite in which you're creating user profiles the way you're doing for a single user instance. Create a conditional loop after a single user instance is created. Put a Groovy script that increments the value before the conditional goto test step and you should be ready to go. Along the way, you'll need to use property expansion inside your request.

    I hope this helps.


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla