Forum Discussion

BhuvanShanmugam's avatar
BhuvanShanmugam
Contributor
9 years ago

Reusing Test Case/Suite

I have a test case which takes input from project property. This is fine for a single shot test.

However for load tests, I see a Datasource is best suited.

 

How do I re-use testcase/suite for a single run and the load test with minimal overhead (or) better , no repetition at all.

 

Thanks

Bhuvan.

 

 

  • nmrao's avatar
    nmrao
    9 years ago
    Ok in that case, I would prefer not use the SoapUI's load test, instead will go with a groovy script which will have better control to read the data source and run the test as well from with in the script.
  • nmrao's avatar
    nmrao
    Champion Level 3

    Suppose, current test case has request element as shown below which is using project level property

     

    <requestElement>

         <color>${#Project#COLOR}</color>

    </requestElement>

     

     

    If the targeted application accepts any string, then it is easy to transform the above as below

     

    <requestElement>

         <color>${=java.util.UUID.randomUUID().toString()}</color>

    </requestElement>

     

    Now, both regular and load test should not have any issue to send the dynamic & unique value each time.

     

    Similarly, you may use random integer or timestamp etc.,

     

    Hope this help.

    • BhuvanShanmugam's avatar
      BhuvanShanmugam
      Contributor

      Dear nmrao,

       

      That is one suggestion, but I guess it would not work for me.

      I am looking for non-random (specific) values to make the calls.

      One workaround i thought of is to have 2 sets of files;

      a - single test

      b - load test

      Also have the file name and location as project property.

      And a startup script to setup either single or load test in the project proeprty.

       

      Then run the required script; and followup with the actual tests.

      Based on what file is chosen, the appropriate data set will be fed into the data source loop.

       

      Unless, there is a better way that someone can suggest...

       

      Bhuvan.