Forum Discussion

RichBopp's avatar
RichBopp
Contributor
7 years ago
Solved

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?

 

 

  • 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.

16 Replies

  • 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.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        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.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

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

  • shankar_r's avatar
    shankar_r
    Community Hero

    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/

    • RichBopp's avatar
      RichBopp
      Contributor

      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's avatar
        NisHera
        Valued Contributor

        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.