Ask a Question

Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

SOLVED
Marsha_R
Community Hero

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

I'm just lazy.  I got tired of cutting and pasting it for every place I needed a number.  πŸ™‚

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tristaanogre
Community Hero

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

Threw this together quick... JScript/JavaScript compatible.  If you are using keyword tests, call this script routine and then you can use "Last Operation Result" in either a variable assignment or a parameter to utilize it in other operations.

 

function getUniqueID(digitLength) {
    var JJJHHMM = 7;
    var JJJYYHHMM = 9;
    var MMDDYYHHMM = 10;
    var MMDDYYYYHHMM = 12;
    var MMDDYYYYHHMMSS = 14;
    try {
        switch (digitLength) {
            case JJJHHMM: return aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%j%H%M');
                break;
            case JJJYYHHMM: return aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%j%y%H%M');
                break;
            case MMDDYYHHMM: return aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%m%d%y%H%M');
                break;
            case MMDDYYYYHHMM: return aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%m%d%Y%H%M');
                break;
            case MMDDYYYYHHMMSS: return aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%m%d%Y%H%M%S');
                break;
            default: throw Error('An unknown digitLength was used.  Please use a value of 7, 9, 10, 12, or 14');
        } 
    } 
    catch (exception) {
        Log.Error(exception.message, exception.stack);
        return 'error';
    } 
    
} 

I'm also going to incorporate this into the OgreUtilities script extension.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
RichBopp
Contributor

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

Gang,

 

Thank you so much for all of the suggestions.  I'm neck deep in a testing cycle right now, but will get back to trying all this out by the end of this week.

 

Kudos to All,

 

Rich

RichBopp
Contributor

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

Gang,

 

Kevin Johnson over at Tyler Technologies was able to provide me with a Keyword-ish solution that works very well when you need to create a unique entry in an alphanumeric field, and I wanted to share it.

 

See the Attachment I've added for steps and screenshots.

 

Kudos to Kevin.

View solution in original post

Marsha_R
Community Hero

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

Yep.  That's pretty much what @tristaanogre and I both mentioned.  Good luck with it!

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tristaanogre
Community Hero

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

Yup, if you look at the code I posted, it does EXACTLY that... the difference is that I give you a function that returns the value based upon the desired length.  I find this easier than having to do the Code Expressing in the "Keys" field.  I just call that function and then Use "Set Variable Value" and use "Last Result" as the value to set.

 

Note that we have the bonus of that function being present in a Script Extension so that, no matter what project I'm running, I always have that function available.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
AlexKaras
Community Hero

Re: Data Generator Wizard: EMail and Name - How do I generate a new entry each iteration?

And, as the initial question was about email:
I am sure that you know that at least gmail has a feature that '+<something>' suffix can be added to the email address before the @ symbol and all such addresses will be mapped to the base address.
I.e.:
user@gmail.com
user+20171113@gmail.com
user+20171114@gmail.com
user+20171115@gmail.com
all will be unique and valid email addresses mapped to the user@gmail.com base one.

 

Maybe the same works for (some) other email servers.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β