Forum Discussion

Rene_Hansen's avatar
Rene_Hansen
Occasional Contributor
18 years ago

Load test with shared DataSource?

Hi all,

First off, I'm totally new to SoapUI PRO, so be gentle on me 

What I want to do:
I want to do a Load Test with multiple threads and data input from a file.

What I have done:
First I created a DataSource (type: grid) where I entered the data needed (a single column containing a unique order ID) and entered 10 order IDs. I checked the "Shared" option.
Then I created 2 SOAP requests (1 for creating the order, 1 for completing the order), where I used ${TestOrderId#OrderId} to insert the values into the request.
Then I created a Load Test with a limit of 10 total runs and 5 threads.

When I ran the load test, I could see in my system that all 10 order IDs were created correctly and no errors occured - meaning that the 5 threads shared the 10 order IDs perfectly. So far everything works as I wanted - perfectly indeed.

I then created a new DataSource (type File this time) and pointed it to a file containing the same 10 order IDs as the Grid DataSource. Changed the two requests to use the new DataSource instead, and then ran the LoadTest again.
This time the result was different (though expected to be the same). When I checked my test system I saw that order 1 and 2 where created 5 times - which leads me to think that each thread started from the same row of data.

What I want to achive is something like this:

Line 1 is read by thread 1
Line 2 is read by thread 1
Line 3 is read by thread 2
Line 4 is read by thread 5
Line 5 is read by thread 3
...
Basically avoid the same line being read more then once.

Using the Grid data source might be a solution, but it would be much better if the data is read from a file (as the data changes often and another system is already exporting/updating this file).

As I am new to SoapUI PRO, I am not sure whether this is a bug or my approach is wrong. I have tried to look at the user guides available, but have become none-the-wiser.

If anyone could help me clarify how to make this work, you would make me one happy tester 

P.S. I have tried this using SoapUI PRO 2.0 and 2.0.1

P.P.S. Thumbs up for SoapUI in generel!!!

5 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    thanks for posting.. If you had checked the "shared" option for the File DataSource then this sounds like a bug to me.. I'll see if I can reproduce..

    regards!

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Rene,

    I've tried to reproduce this but get ok results with the shared FileDataSource and a LoadTest like you describe. I wonder if you could mail me your project file (ole@eviware.com) so I can see if there is something else specific to your project that is causing this, would that be possible?

    thanks in advance!

    regards,

    /Ole
    eviware.com
  • Rene_Hansen's avatar
    Rene_Hansen
    Occasional Contributor
    Hi Ole,
    Thanks for the reply - the project file has been by mail today.
  • Rene_Hansen's avatar
    Rene_Hansen
    Occasional Contributor
    Just an update for everyone who should encounter the same problem.
    Thanks to Ole (omatzura) and his e-mail-life-support, I got the problem fixed. This is what I did:

    First, I added a DataSourceLoop (should have added that already just from reading the "how to get started guides", but somehow missed it) as the last sted, so it looked something like this:
    1. data source (file)
    2. Soap request (using parameters from the file)
    3. Soap request (using parameters from the file)
    4. DataLoop (looping to step 2).

    Second, I change the "Load test" configuration field "Thread Startup Delay" from 0 to 1.

    These two changes solved the problem.
    Hope this helps others, should they encounter the same problem
  • kiran_load's avatar
    kiran_load
    Occasional Contributor
    Rene Hansen wrote:

    Hi all,

    First off, I'm totally new to SoapUI PRO, so be gentle on me 

    What I want to do:
    I want to do a Load Test with multiple threads and data input from a file.

    What I have done:
    First I created a DataSource (type: grid) where I entered the data needed (a single column containing a unique order ID) and entered 10 order IDs. I checked the "Shared" option.
    Then I created 2 SOAP requests (1 for creating the order, 1 for completing the order), where I used ${TestOrderId#OrderId} to insert the values into the request.
    Then I created a Load Test with a limit of 10 total runs and 5 threads.

    When I ran the load test, I could see in my system that all 10 order IDs were created correctly and no errors occured - meaning that the 5 threads shared the 10 order IDs perfectly. So far everything works as I wanted - perfectly indeed.

    I then created a new DataSource (type File this time) and pointed it to a file containing the same 10 order IDs as the Grid DataSource. Changed the two requests to use the new DataSource instead, and then ran the LoadTest again.
    This time the result was different (though expected to be the same). When I checked my test system I saw that order 1 and 2 where created 5 times - which leads me to think that each thread started from the same row of data.

    What I want to achive is something like this:

    Line 1 is read by thread 1
    Line 2 is read by thread 1
    Line 3 is read by thread 2
    Line 4 is read by thread 5
    Line 5 is read by thread 3
    ...
    Basically avoid the same line being read more then once.

    Using the Grid data source might be a solution, but it would be much better if the data is read from a file (as the data changes often and another system is already exporting/updating this file).

    As I am new to SoapUI PRO, I am not sure whether this is a bug or my approach is wrong. I have tried to look at the user guides available, but have become none-the-wiser.

    If anyone could help me clarify how to make this work, you would make me one happy tester 

    P.S. I have tried this using SoapUI PRO 2.0 and 2.0.1

    P.P.S. Thumbs up for SoapUI in generel!!!



    Hi,
    How did u use.....${TestOrderId#OrderId} this. Could tou plese elobrate on this...i wnat to use this in my project