Forum Discussion

Gill's avatar
Gill
Occasional Contributor
2 years ago

How to increment a variable value when using Genarte Data to test

I am trying to create a test scenario for creating a new account. Whenever I run the test case I want to use a new name value for the account I create, so I am using Generate data and use the Name option and first name. Still, whenever I run the test, it only shows the 1st name in that column; when I run the test 2nd or 3rd time, it uses the same name every time. 

can anyone help me with this issue, I don't know programming or how to use VB script or Java script.

 

 

appreciate your help and support. 

 

thanks, 

Gill 

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    I don't know programming

    In this case I would try to use Custom String generator from Data Generator wizard and set it to generate some unique random value. As an example, I am adding current date/time as a suffix to the generated name. Such suffix, on the one hand, provides data uniqueness while on the other hand makes it possible for you to understand when this given account was created.

    Macro template from my example (one line):

    Account #%INT(1,2147483647,1,*RND)-%TIME("12/8/2023 09:46:00","3/17/2024 09:46:00","MMM_dd_yyyy_HHmmss",1:12:24:48)

     

     

    Does it help?