Test Data Manager

Expand all | Collapse all

Test Data Generation for varying static field row count

Jump to Best Answer
  • 1.  Test Data Generation for varying static field row count

    Posted 06-10-2018 12:42 PM

    Hi Team,

    We have a requirement to generate the data for 3  fields where data for 2 static columns should be generated with varying in the count of rows which is provided by the user. 

    for eg,

    We have 3 columns in the table TBANK having column (CompanyName,Country,Address)

    The data is required to be generated for 3 column for in below pattern. 3 for Companyname as "Infy" and 3 for "TCS"

    CompanyName,Country,Account_number

    Infy                    , India, INDAC1233567

    Infy                    , India, INDAC1234568

    Infy                    , India, INDAC1235569

    Tcs                    , India, INDAC1333567

    Tcs                    , India, INDAC1434568

    Tcs                    , India, INDAC1635569

     

    Now again if user wants 100 for "Tcs" and 50 for "Infy" , He should be able to do it own its own without any modification. The  requirement is very similar like "Test data on demand" where user can choose specific requirement from TDOD portal and able to mine the data...in similar manner we have to for test data generation where user can provide number for rows of varying static type like (10 rows for "Infy" and 20 rows for "Tcs" or 20 rows for "infy" and 30 rows for "Tcs") and he should be able to do it own its own like "Test data generation on demand" . 

    Let me know if it is possible to do by using Agile designer like TDOD and create portal for test data creation.

     

    Thanks,

    Rajeev Kumar.

     

     

     



  • 2.  Re: Test Data Generation for varying static field row count
    Best Answer

    Broadcom Employee
    Posted 06-11-2018 12:02 PM

    Hi Rajeev,

     

    Please try the below approach to see if it works for you. Define two variables, one for holding the count for the first company and the other for the second one. Now create a third variable say total rows which would hold the sum of the 2 variables as below. You will set this variable to use as the table repeat count for the table on your publish screen.

     

    @sum(~comp1_count~,~comp2_count~)

     

    Now you would create a single row in your data pool. For the CompanyName column you would use the below function.

     

    @if(~ROWNUM~<=~comp1_count~,Infy,Tcs)@

     

    Now if you publish the data pool, you should be able to see the correct distribution of values, say 10 for Infy and 20 for TCS.