Forum Discussion

ROTO1's avatar
ROTO1
Staff
4 years ago

How to create variables at the test suite level while creating load test.

  • We need help to understand how to create variables at the test suite level while creating load test. For example, Please refer to the below steps:

     

    1. Perform ‘GET Test step’ at one test case where parameters for GET step are available at same test case another step.
    2. Perform ‘Delete Test step’ at another test case where resources for DELETE is ‘ID’ test property from STEP 1 ‘GET Test step’ JSON Response.

     

    We are using the ‘get data’ functionality of READYAPI which works correctly in the case of functional testing.

    But seems it does not work in load testing as intended and gives an error. Because it keeps on referring to ‘ID’ created in functional test.

    We need to have ‘ID’ created dynamically to work the Load test correctly.

     

    Please refer below details :

    ID parameter created using get data :

    Variable from one case to another for ID: “${#[Positive Scenarios_7.0_2022#Master Schedule#HTTP Request Section GETPATTERN_copy]#ResponseAsXml#//Response[1]/e[1]/id[1]}”

    Variable within same case for ID: “${HTTP Request Section-GETPATTERN_copy#ResponseAsXml#//Response[1]/e[1]/id[1]}”

  •  
  •  
  •  
  • I have tried using setPropertyValue along with groovy script which also works for functional test but failed to load with the same error.
  •  
  • Please refer to attached my groovy script which gets executed before the delete action. It gets value from previous test case and stores the value to property “SectionID” at the Delete test case level (Delete Master Schedule as per below screenshot). While running delete action, it refers this “SectionID”.
  • Can anyone try our scenario with any open API (e.g. Post & get in one test case and delete from another test case) at readyapi load and share results?

 

  • richie's avatar
    richie
    Community Hero
    Hey ROTO1,

    I didnt answer on this cos ive been overloaded at work.

    I'll try reproducing if you can give me a couple of days.

    What version of ReadyAPI are you using?

    Cheers,

    Rich
    • ROTO1's avatar
      ROTO1
      Staff

      richie Thank you! we are using 3.10.1

       

       We tried adding a data Sink test step after the get test step, so the test case would write the ID to a location. Then in the delete test case access where the Data sink wrote the ID. Data sink with Excel worked for functional testing and also for 1 Vu load testing. But When it is used with 2Vus load, it’s corrupting an excel file.

       

      Then, In the Data Sink Options section, we tried “Sets to share this Data Sink between running threads during a Load Test” This option did not corrupt the excel file but it starts giving the same 404 error for the delete section. So we are kind of stuck