Perhaps there is another design pattern we should be following, so please feel free to offer up other patterns which can solve this problem if we are indeed at a dead-end.
Our test cases involve entering form data on a web-application, however the form data values need to be generated before the test case runs, as execution of the test will consume the data and not allow us to re-run the test case without generating a new data set.
Our plan was to ingest data into our database in the setup phase, and write this dynamic data into CSV files which are already data-bound to Katalon Test Data objects and the accompanying test case. I have most of this working fine, however I have found that the Test Lifecycle causes the data binding to occur before the Test Listener / Test Suite Setup hooks, so the data is already stale.
Based on these resources, this is what I believe is happening:
startTestSuite entry point: https://github.com/katalon-studio/katalon-studio-testing-framework/blob/64c7915b8d478adac844b7b7da6cd15b38aead4c/Include/scripts/groovy/com/kms/katalon/core/main/TestCaseMain.java#L146
Execute Test Suite
- startTestSuite is called with the existing CSV file loaded as the data binding
- listeners/test suite setup methods are called – we create our new data objects in the database and write their IDs to the CSV
- test cases run with the original data binding values
Any help would be greatly appreciated.