Thomas K
Thomas K

Reputation: 1117

Apache jMeter : Perform load test and delay verification

I would like to perform a load test on a SOAP webservice.

There are two requests :

  1. createDocument. Input: name, size, date. Output: id's document newly created
  2. getDocument. Input: document id. Output: id, name, size, date

I would like to perform a load test on the createDocument method. Not rocket science, I use the SOAP sampler, very simple.

But in a second step, after the load test (for performance reason) I would to check if the document are really created by calling getDocument with the id.

My idea :

I don't know how to loop over a Java list and call a SOAP sampler for each iteration. Any idea ?

Or generally, do you have a solution more jMeter compliant ?

Thank you

Upvotes: 0

Views: 168

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

In the second thread group:

  1. Add a Beanshell Sampler which will iterate through the list with document IDs and store them into JMeter Variables, something like:

    List IDs = bsh.shared.IDs;
    
    int counter = 1;
    
    for (String ID : IDs){
        vars.put("ID_" + counter,ID);
        counter++;  
    }
    

This will result in variables like:

ID_1=somedocumentid
ID_2=someotherdocumentid
....
etc.
  1. Add a ForEach Controller and configure it as follows:

    • Input Variable Prefix: ID
    • Output Variable Name: anything meaningful, i.e. CURRENT_ID
    • Make sure that "Add "_" before number" is checked

ForEach Controller will iterate through all defined variables with ID_ prefix and you will be able to refer the current value as ${CURRENT_ID}

Reference material:

Upvotes: 1

Related Questions