Forum Discussion

Dunger's avatar
Dunger
New Contributor
15 years ago

[Resolved] Load Testing with dynamic attribute value

Hi,

Firstly, sorry for a basic question here, but I want to be sure I'm heading down the right track before looking into this more.

I'm new to soapUI / loadUI, and was wondering whether it is possible to load test a web service, were by the value of an attribute in the request can change per request?

i.e. We have an attribute called <quantity>

For the first request the value of <quantity> is 5
Next request <quantity> is 10
Next request <quantity> is 7
Next request <quantity> is 18
Next request <quantity> is 2
etc, etc.

Is 'Data Driven' testing the way to go here, were by the <quantity> value could be in a text file or Excel spreadsheet?

Best Regards.
D.

6 Replies

  • Hi!

    That might very well be the way to go. It depends on where you get your Quantity data from (e.g. if they are random, then there are easier ways than Excel spreadsheets).

    /Henrik
    eviware.com
  • Dunger's avatar
    Dunger
    New Contributor
    Thanks for update Henrik.

    They could be totally random as well as ordered. As well as that, there could be between 10 to 1000 of these entries.

    In the future, there could be anywhere between 1 and 10 attributes per request. Currently, just the one.

    When you mentioned "..easier ways than Excel spreadsheets", could you elaborate please?

    Best Regards,
    D.
  • The things you describe are definately possible in soapUI+loadUI.
    Dunger wrote:
    When you mentioned "..easier ways than Excel spreadsheets", could you elaborate please?

    Well, for example you could make a call in soapUI like this:
    <quantity>${=new java.util.Random().nextInt(20)}</quantity>

    To generate quantity-tags with (random) values between 0 and 19.

    /Henrik
  • binardo's avatar
    binardo
    New Contributor
    Hi,

    I created a LOADUI component to set parameters that are then passed into SOAPUI (see attached). You can set them to increament or cycle through lists of values. If you need it to randomise then you could easily edit the counter in the code to be a random value when selecting the item from the comma separated list.
    Just put the .groovy file in your eviware\loadUI-1.0.1\script-components folder and it will be instantly available in LOADUI. If you open the .groovy file in a text editor it has instructions on parameterising you SOAPUI test case, though I think you might need SOAPUI pro.

    Alternatively I have an edited version of the SOAPUI teams example custom component that reads in a .csv file and applies the read values to parameters named on the component. That can read the rows in the file randomly.
  • Hi Andrew,

    Looking really good! I'll play around with it more once I got the time. Should we consider this an entry to the component competition?

    /Henrik
    eviware.com