Easily split your CSV dataset with Microsoft Azure Load Testing

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

Splitting your data source files shouldn’t be a chore. With the Azure Load Testing Preview all you need to do is check a box to get unique datasets when testing your workflow.

 

Registering and authorizing your users are major steps in the customer journey lifecycle within an application. You want to make sure that the load test engine receives unique values for registration and login functionalities. Failure to do so can result in duplicate logins and registration errors that abruptly end user sessions. This undermines the quality of the test.

 

Azure Load Testing is the powerful tool you’ll want to use to deal with these challenges.

 

Here’s a scenario:

You’re working with a team that’s launching a new e-commerce membership program in the next quarter and you want to test the application lifecycle from sign-in to checkout. You want to assess how much load your application can handle based on peak traffic metrics you’ve experienced in the past.  For this let’s say, you would want to simulate the sign in or register scenario with 10,000 users and 5 load engines. You have prepared a CSV dataset file which looks somewhat like the below:

Sachidanand_Sharma_0-1660052315486.png

 

We will look at how you can split this dataset into 5 unique datasets of 2000 users each and pass to the Azure Load Testing service using the JMeter CSV Data Set Config element in your test and the service's functionality to split the data into multiple datasets.

 

Let’s do this.

 

How to do a CSV split

(The example below assumes that a load test resource already exists. If not, create an Azure Load Testing resource here.)

  1. Add the JMeter CSV Data Set Config element to your test plan.
  2. Configure your JMeter script to read your CSV dataset file. (How to instructions)
  3. For each CSV Data Set Config element:
    • Update the filename element and remove any file path reference.
    • Add the CSV field names as a comma-separated list in Variable Names.
    • Enter the variable names in the CSV Data Set Config element instead of using a header row in your CSV datafile.

csv-datasetconfig.png

4. Go to the created Azure Load Testing resource on your Azure Poral and select Tests > Create > Upload a JMeter script.

createtest.png

 

5.  Go to the test plan tab and upload your CSV dataset file with the JMeter script

6.  Select “Split CSV evenly between Test engines”. To split it across 5 engine instances go to the load tab and configure Engine instances value to 5. This will split the data set into five subsets and send those unique lists of users to each load test engine

 

configure-test-split-csv.png

 

 

(NOTE: Here’s a tutorial to do this within the CI/CD pipelines.)

 

So, we used the Split CSV feature to pass a unique dataset to load test engine for a login scenario with just six steps. Now try running your login and register scenarios. You can join our global developer community with feedback and insights here.

 

Happy LoadTesting!

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.