cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure a thread to run test step for only once in a load test

Occasional Contributor

How to configure a thread to run test step for only once in a load test

Hi

I am executiong a load test with  1 test step

i have total thread count of 60

one teststep of mine looks like


       
        12
       
        SoapUI Pro
       
        GBR
   

how can i configure each thread to execute this test step for only once 

I am having a properties file with 60 booknames

i want each thread to put book buy requests taking booknames one by one  from my properties file

on a whole 60 threads  should put 60 book requests as 1 book buy request per thread


if u can provide some sample code for this requirement .it would be really helpful
7 REPLIES 7

Re: How to configure a thread to run test step for only once in a load test

Hello,

Each thread runs test case only once. In SetUp script for loadtest load property file and add properties to test case ( book1, book2, etc)

than in request you could have :


<pub:BookBuyRequest>
        <!--Optional:-->
        <com:bookId>12</com:bookId>
        <!--Optional:-->
        <com:bookName>${#TestCase#book${#ThreadIndex}}</com:bookName>
        <!--Optional:-->
        <com:Language>GBR</com:Language>
</pub:BookBuyRequest>



So, each thread will send one request with one book based on thread index.

Let me know does it helps,
robert


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: How to configure a thread to run test step for only once in a load test

Hi

I think i didnt explain my problem clearly .I am explaining it once agian
i am running a load test. i have one test step like above mentioned
i have thread count of 60. i am using strategy as simple.i am running the test for 600 sec.
all my sixty threads should execute the test step only once .
i want to take all my values from text file as (CSV).

i have run some normal test.i found same thread is exceuting the test step again and again and other threads just putting empty requests .i want to restrict such that when a thread gets started.it should take its values from text file based on its index. and run the test step only once.such that 60 threads should run a test step only once and put on a whole 60 requests taking values from text file based on their  thread index.


if u can provide some sample code for this requirement .it would be really helpful

Re: How to configure a thread to run test step for only once in a load test

Hi,

when you are using load test every test case is running in separate thread.
And ThreadIndex property is counting from 0 to number of threads you choosen.
You can use this ThreadIndex property to fetch indexed row from your file.

Example:
on test case level add 5 properties :
book - value0
book1 - value1
book2 - value2
book3 - value3
book4 - value4


then in test request

       
        12
       
        ${#TestCase#book${#ThreadIndex}}
       
        GBR


when you run load test with 5 threads you will have requests like this
...
        book0
  ...
...
        book1
  ...

...
        book2
  ...


Hope this helps

Regards Nebojsa
eviware.com


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: How to configure a thread to run test step for only once in a load test

Hi

I have done the same.i have given thread count as 60.but only eight threads  executed the test step . 52 threads didnt have their run .I am explaining more details in the attachment

Re: How to configure a thread to run test step for only once in a load test

Hello,

Hm, can you send us a project file, at support@eviware.com,  which we could use to reproduce this.

robert


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: How to configure a thread to run test step for only once in a load test

I cannot send my project.But its simple to reproduce it. its just a scenario.it doesnt depend  any project.i.Just apply the same steps on any sample project .it will happen the same on any project.I am using soapui pro 3.0.1

Re: How to configure a thread to run test step for only once in a load test

Hi!

can you please try the upcoming nightly-build to see if this is working better now?

thanks in advance!

regards,

/Ole
eviware.com


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors