Forum Discussion

jaswany's avatar
jaswany
Occasional Contributor
15 years ago

Help with Data Generator

Is there a way to setup a keyword test to generate an Excel file with random data using the Generate Data feature?  I created a data driven loop with data that I generated with the Generate Data feature.  The test runs great once I setup all my variables to use the Excel sheet.  The problem is I don't want to have to go into TestComplete before every single test run, setup all my coulums, data type, configuration, etc. each time the test is executed.  I want to kick off a test and have it know to create a test data file and use that file to run through the tests.  Is this possible?

5 Replies

  • gid_216's avatar
    gid_216
    Frequent Contributor
    Hi Joshua,



    The datat generator can generate data into an excel file also which you can use in scripting.
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi, Joshua.


    Is there a way to setup a keyword test to generate an Excel file with random data using the Generate Data feature?


    No, currently, you cannot generate Excel files from your keyword test. We have such a suggestion in our DB, and your request has increased its rating. Thanks for your feedback.


    However, you can generate Excel files using TestComplete's built-in Data Generator feature via the Data Generator wizard. This wizard is only available from TestComplete's GUI, and you cannot access this feature from tests (keyword or script). To open this dialog, select Test | Generate Data from TestComplete's main menu.


    If you need your test to use different random data during each test run, you can, for example, generate a large Excel file using the feature described above and then use the Data-Driven Loop operation to specify the records that belong to the generated file and will be processed by the current test run. That is, the first test run may use the records from 1 to 50, the second test run - from 51 to 100, and so on. Using this approach, you will not have to generate a new Excel file each time before the test execution.


    For more information, see the Data Generator wizard help topic.


    BTW, you can create Excel files from scripts when working with Excel via COM. However, in this case, you will have to fill up these files manually (or, as an alternative, you can use any stand-alone data generator). For more information, see Working With Excel Files via COM.

  • jaswany's avatar
    jaswany
    Occasional Contributor
    Thanks Irina.  That is a good idea about specifying the columns to be used.  I didn't think of that.  Thanks for bumping up the enhancement request!
  • Hi Irina Lukina,



    I have follow video on data generator and have created data, but in video it only explains how to use these data in keyword test but not in script test.



    Would you mind to let me know how can we use generated data into scripting?



    Many Thanks,

    Sam