Test Data series
Test data preparation
How do you get your test data?
- If you are lucky, you just have to “request” for it and they will generate it for you.
- If you are less lucky, there will be a good test database in which you can search for test data according to your preferences.
- If you’re even less lucky, you’ll get a database into which you can edit test data to suit your own purposes.
- If you have even less luck than the previous ones, then you have to somehow generate your test data.
Test data generation tips series is about trials with the least amount of luck. In this article, we will create e-mail addresses where it is even possible to receive e-mails.
Endless secrets of Gmail
First steps
If you only need one e-mail, it’s easy, we create an e-mail address with a free e-mail service provider. Let’s choose gmail, because it will be good for us now.
Let’s make a free email address, e.g.: tester.passed@gmail.com
Dot. Dot.
The first secret we should note that text content before @ of the gmail address can be „dotted” or „undotted” based on your demand. It means that the following addresses are the same:
- tester.passed@gmail.com
- testerpassed@gmail.com
- t.ester.passed@gmail.com
- t.esterpassed@gmail.com
- t.e.s.t.e.r.p.a.s.s.e.d@gmail.com
and so on. Now, we could quickly calculate how many e-mail addresses we have, but you indicated that you do not want to continue your education in mathematics, so we will skip this calculation. I will tell you that it is a lot, but not endless.
An infinitely simple Plus
What provides even more options than the previous one is the use of the “+” sign. Because we can write anything after the “+” sign written after the name and it will still be the same e-mail address. I show you:
- tester.passed+something@gmail.com
- tester.passed+testing@gmail.com
- tester.passed+test0001@gmail.com
- tester.passed+you can type any long text as per your demand@gmail.com
Don’t count! Of course, there is obviously a limit to this, but for us this limit is so large that it is essentially infinite.
How we can use them
It is worth using this in some context. For example, if we need 10,000 test e-mails for our Alfa project, it can be generated in an Excel table based on this pattern:
tester.passed+Alfa_0000@gmail.com,
tester.passed+Alfa_0001@gmail.com,
tester.passed+Alfa_0002@gmail.com,
…,
tester.passed+Alfa_9999@gmail.com
and this is it. If the system would send a message to any e-mail address, we can read it at the e-mail address tester.passed@gmail.com. You can filter the mails received by any recipient by searching.
Summary
As far as I know, the above tricks only work in Google’s e-mail, they are not standard functions in other well-known e-mail systems. We used the above method on several test automation projects and it worked perfectly. We were able to process even the returned e-mails easily. (For example, to find and open recurring approval links.) Of course, the method can also help with manual testing. (I tell you that I don’t only use it for testing, I also apply the method for personal data entry, when I know that my e-mail address is only being asked for data collection somewhere, then I enter something similar there: myemailaddress+registration@gmail.com. With an automatic filter, I automatically forward mails received here to the trash.)
Have a good test data!
Keep it going!