Petr is an R&D Manager with more than 20 years experience in leading software development teams.

Become a JMeter and Continuous Testing Pro

Start Learning
Slack

Test Your Website Performance NOW! |

arrowPlease enter a URL with http(s)
Jun 03 2021

How to Generate Email Addresses with Values From Your Own Seedlist

This is our fourth and final blog post in the series about generating email addresses with BlazeData. Here’s what we covered so far:

1. How to Generate Parameterized Email Addresses for Your Test Runs with BlazeData - explains how to reference parameters inside other parameters to create email addresses. 

2. How to Generate A Unique Email Address for Your Test Run with BlazeData - explains how to assure your email address will always be unique. 

3. How to Generate Email Address Separators with BlazeData - explains how to add email separators.

 

This time, we’ll cover how to create your own seedlist. This is helpful when you want to use values from your own list.

 

Let’s start with this data model:

 

Index - sequenceGenerator()

Firstname - valueFromSeedlist("firstnames", $Index)

Lastname - valueFromSeedlist("lastnames", $Index)

Domain - "acme.com"

Separator - valueFromList($Index, [".", "_", "-", "+"])

Email - ($Firstname + $Separator + $Lastname + "@" + $Domain).replace(/ /g, $Separator)

 

Let’s see how we can replace a Firstname with value from our list. In order to provide BlazeData with your list of values, you have to create a CSV file where each value is in its own row. For the sake of this example, you can use the ‘Download Generated CSV’ action in our Test Data panel.

 

Test Data 
Example • My Own 
Download Generated CSV

 

Once you have your CSV ready, import it to the test data panel using the ‘Import CSV File’ action under the ‘+’ button.

 

lect All fi 
Create 
New Data Parameter 
New Data Parameter from Example 
New CSV File (Data Table) 
Import 
CSV File 
Attach 
CSV File From Shared Folders 
TDM Find & Reserve Model

 

Your CSV file will appear in the Test Data panel. Now you are ready to use it instead of predefined seedlists. To do this, we will use the ‘valueFromCSV’ function. Our Firstname attribute will change to this:

 

Firstname - valueFromCSV("my-seedlist.csv", 8, $Index)

 

The first attribute of the function is the name of your CSV file, the second is the column that should be used and last one is the row you want to get from your list.

 

 

In case you would like to get random values, you can change it to something like this:

 

Firstname - valueFromCSV("my-seedlist.csv", 8, randInt(1, 300))

 

This will take the first 300 values from your list and return them in   random order. If you have less than 300 values it will loop through the existing ones. Feel free to increase this number in case you have more values in your CSV.
 

That’s it! You now have everything you need to get started with Test Data email address generation. To get started with BlazeMeter, sign up for free here.

   
arrowPlease enter a URL with http(s)

Interested in writing for our Blog?Send us a pitch!