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.