Service Virtualization

Expand all | Collapse all

Issue with Multipart MIME step with load testing

Jump to Best Answer
  • 1.  Issue with Multipart MIME step with load testing

    Posted 03-07-2019 08:16 PM

    I'm trying to use MultiPart MIME step which reads file data and encodes and store it in a property in bytes - which is then used to HTTP step in post parameters ( As described in documentation). This is working fine when i test for single file. When we have to test with multiple files using "instance" property to read filename and hit HTTP step, most of the time duplicate files are being hit to HTTP step - even though logs are showing correct instance and correct file is picked up.

     

     

    If i have staging doc as 5 users and stage the TestCase with above 2 steps, results may be like instances of 0,0,0,2,2 instead - 0,1,2,3,4 or any sequence (without repetition). Any quick help is much appreciated.



  • 2.  Re: Issue with Multipart MIME step with load testing

    Posted 03-08-2019 12:57 AM

    HI,

             Could you share your test case please. 

     

    regards

    Sankar



  • 3.  Re: Issue with Multipart MIME step with load testing

    Posted 03-08-2019 01:31 AM

    Hi,

     

    I may not able to share complete testcase, however below are the 2 steps i'm talking about.

    So, my results in backend system are:

     

    Here 0 & 1 are instances. When i staged, the results should be 1,2,0 .. but same instance is being repeated

     



  • 4.  Re: Issue with Multipart MIME step with load testing

    Posted 03-08-2019 06:47 AM

    Hi.

            Could you drive the test using a Dataset 'Load a set of file names'. Please refer to the screenshots below on how to read files from a folder. The data set loads the file names as per the filter and store it in a property with the same name as that of the DATASET NAME. In the example below, the dataset stores all the file names (with complete path) into a property which can be access as {{filePath}}. Note that, the dataset name in the example is 'filePath'.

     

    The MIME step refers to the same property as shown in second screenshot.

     

     

     

    regards

    Sankar



  • 5.  Re: Issue with Multipart MIME step with load testing

    Posted 03-08-2019 11:41 AM

    Thanks for the help, however reading filename form dataset also did not helped for my requirement. I had also added logic to reset the Dataset . Raising a support ticket now, as this needs to be solved asap for our requirement.

     

    1) Copied directory path as below;

    testExec.setStateValue("directory","Desktop/Lisa_/100_0/"+testExec.getStateValue("instance"));

    2) When i staged TC with 3 instances, i still see 0.xlsx uploaded all time. Basically requirement is, take the correct excel from local folder based on the instance and hit the URL configured on HTTP Get step.

    This case, i'm still seeing all are uploaded with 0.xlsx, instead of all 3 sequences even though files are present in each directory. 

     

     



  • 6.  Re: Issue with Multipart MIME step with load testing
    Best Answer

    Posted 03-28-2019 01:01 AM

    Hi Raji

             As we have worked it out over the support case, your requirement was achieved by moving the MIME + HTTP/HTML Step into a separate test and invoke it as a SUB-PROCESS from the main test.

     

    This approach has allowed us to read the files based on the instance number (user); 0.xlsx, 1.xlsx, 2.xlsx

     

    Besides, we also noticed that the SUB-PROCESS was not handling HTTP Redirects 302 automatically; hence the following property need to be set to specifically instruct the sub-process to handle HTTP redirects in automated way.

     

    The following screen shots show the Main Test, the SUB-Process as well as the HTTP Redirect property.