This is a migrated thread and some comments may be shown as answers.

Test using random email address

12 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wade
Top achievements
Rank 1
Wade asked on 10 Mar 2015, 12:05 AM
Greetings,

I need to test a page for a free sample. However, each email address can only be used once.

How can I generate random email addresses to run this test?  I saw another article related to this, but the links in the article were broken.

Thanks

Wade

12 Answers, 1 is accepted

Sort by
0
Wade
Top achievements
Rank 1
answered on 10 Mar 2015, 12:34 AM
This is the other post I saw.

Other post
0
Wade
Top achievements
Rank 1
answered on 10 Mar 2015, 10:43 PM
Anyone?
0
Ivaylo
Telerik team
answered on 12 Mar 2015, 01:33 PM
Hello Wade,

You can create a list with preset emails and use our data driven testing feature.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Wade
Top achievements
Rank 1
answered on 12 Mar 2015, 03:24 PM
I tried that and it works, but unfortunately, each email address can only be used once.
0
Accepted
Ivaylo
Telerik team
answered on 17 Mar 2015, 08:31 AM
Hello Wade,

Since this is not working for you then you need to use your own coded solution with generating a random string and use it as your email address.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Wade
Top achievements
Rank 1
answered on 17 Mar 2015, 09:18 PM
Thanks, I'm not a programmer. I was looking for some help with that.
0
Accepted
Ivaylo
Telerik team
answered on 19 Mar 2015, 11:55 AM
Hello Wade,

Regarding the coded solution unfortunately we do not have such a samples to provide, however you can always take a look over the Internet and find a suitable solution. A good starting point can be this article:

http://stackoverflow.com/questions/730268/unique-random-string-generation

The other solution with using the databinding is also applicable if you create a list long enough for your needs.

Thank you for your understanding.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Wade
Top achievements
Rank 1
answered on 19 Mar 2015, 06:08 PM
I was able to figure it out and I posted my solution in the forum
0
Ivaylo
Telerik team
answered on 21 Mar 2015, 12:36 PM
Hello Wade,

I am glad to hear you have found a solution and thank you for sharing it in the public forum. This could be of a great help of other customers.

Thank you for your cooperation.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Dee
Top achievements
Rank 1
answered on 15 Sep 2016, 05:57 PM
Hello Wade.   Can you post your link to the forum post?   I am looking for a better solution.  Thanks!
0
Jennifer
Top achievements
Rank 1
answered on 20 Sep 2016, 02:06 PM

Here are a couple of functions for generating random character and number strings that take the desired length of string. For the string one, you can add your own combination of upper/lower letters, numbers, etc to the charSet string.

Then in your coded step do something like this

Manager.Desktop.KeyBoard.TypeText(randomString(7) + "@" + randomString(4) + ".com", 50, 100, true)

or 

Manager.Desktop.KeyBoard.TypeText(randomString(7) + "@emailprovider.com", 50, 100, true)

 

public string randomString(int l)
        {
            //Define the length of the text
            int length = l;
            //Define the included characters   
            string charSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

            
            Random random = new System.Random();
            string randomText = new String(Enumerable.Repeat(charSet, length).Select(set => set[random.Next(set.Length)]).ToArray());
            return randomText;
            
        }
        
        public string randomNumber(int l)
        {
            System.Text.StringBuilder num = new System.Text.StringBuilder();
            Random random = new System.Random();
            for (int i=0; i<l-1; i++)
            {
                //pick digit [0-9]
                int digit = random.Next(9);
                num.Append(digit);
            }
            return num.ToString();
        }

0
Boyan Boev
Telerik team
answered on 20 Sep 2016, 02:50 PM
Hello Jennifer,

Thank you sharing your knowledge with the community. 

@Denise, do you need further assistance on this?

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Wade
Top achievements
Rank 1
Answers by
Wade
Top achievements
Rank 1
Ivaylo
Telerik team
Dee
Top achievements
Rank 1
Jennifer
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or