Ask a Question

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

SOLVED
RichBopp
Contributor

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

Does anyone know how to create a variable that will generate new/unique Email Addresses and Names?  

 

I'm creating a Keyword test case that requires unique entries for Name and Email each time it is run.  This is a single iteration Regression test case, so NO data driving required.

 

I was hoping to use the Data Generator Wizard to create a variable (it has a function for creating Email Addresses and Names) - expecting it to create new data each time I run the script, but instead it creates one entry one time and tries to run that data every time I run the script.

 

Any ideas?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
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

16 REPLIES 16
Marsha_R
Community Hero

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

Just curious - what will you be testing by using a random name and email every time?

RichBopp
Contributor

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

Creating a new contact.

shankar_r
Community Hero

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

Hi,

 

Data Generator Wizard is not accessible in Scripts, It can only be used in the GUI going to Test > Generate Data...

 

Instead of creating each time new entry, Manually create a Project variable with Email and Name. Use that for your testing.

 

You can see the below link in-order to get random number to select the Project variable row https://support.smartbear.com/viewarticle/54645/


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

RichBopp
Contributor

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

Shankar,

 

Thank you for responding - but as I said, I'm creating a KeyWord test not Script.  

 

Do you know of a solution that I could use in KeyWord?

 

Rich Bopp

NisHera
Valued Contributor

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

I think best solution would be first (before running any tests.... ) generate what you need data using data generator and store in a table or excel.  then in your keyword  data driven testing use those data.

 

in this case you have to plan how many record you are going run. random generation of data would be difficult if not impossible with KDT only without scripting.  

RichBopp
Contributor

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

NisHera,

 

Thank you for responding, and offering your thoughts.  I'm not creating a data driven test however.  I'm creating a single run (if it passes, of course) regression test of our Create Contact function.

 

As all contacts are unique (I can not create duplicates) - I need to create a new one each time I run the script.

 

I'm finding it very odd that TestComplete has a data generator option that will create a single random email and a single random name one time - when creating a random each time a script is run is much more useful.

 

Right now it seems my best option is:

A - Use the data generator to build a large file - Save it to a table or excel.  

B - Then - Every time I want to run the script - Update the entries in the script.

C - Delete those entries I'm about to use from the file.

D - Run the test.

 

That's a lot of manual manipulation to remember - even with comments.

 

I'm wondering if it is possible to create a data driven script - that will run once - and will delete the last entry from its source file?

 

That might get around this restriction.

 

Rich

tristaanogre
Community Hero

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

What we've done to create new, "randomized" contacts is to not bother with randomization.  

 

I'm working with a healthcare application in which, each time through the test run, I need to add a new "patient"... but the patient has to have a unique SS # that does not equal the SS# for any other patients in the system... so, yes... need a new SS# each time I run the test.  Not data driven, but I just need unique data.

 

Solution: I create my own SS# by concatenating the Julian date (today is 187), the two digit year (17) and the 4 digit 24 hour time of day (1335).  This creates a unique 9 digit number that changes each time I create a new patient.

 

Perhaps, when creating contacts and their e-mails, you can utilize a similar methodology.  Rather than having to create a table that contains the values, just build into your automation code/keyword test something that generates these unique numeric values that you just append onto a default name.  Like, using the above, you could have a contact named "TEST 187171335".  And their e-mail address could be "TEST187171334@x.com".  If need be, you can add the seconds onto that time if your tests take less than a minute, that would add another factor in creating a unique ID.


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
Marsha_R
Community Hero

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

We do something similar to what @tristaanogre does.  We have a variable called idstring that is a combination of date, hour, minute, second and if I need a random string for any field then I use eval(idstring) to get it.  

tristaanogre
Community Hero

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

DOH!  Now why didn't I think of that, @Marsha_R.

 

So... now I'm going to go back to my project, create a property in my framework script extension for that SS# and have it just simply return that unique ID.  I've been doing the dumb thing and creating the string each time rather than from a centralized point... I feel sheepish. 🙂

 

I'll probably also add another property that will return a more lengthy unique ID for other use similar to what you've done.  Thanks for the inspiration!


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
cancel
Showing results for 
Search instead for 
Did you mean: