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.
I think in your case, you need to directly read the CSV while your test is running. It means you need a class that will read that CSV file so that you can get the latest record that you need.
Thank you for the suggestion. I looked at this solution and it would remove the ability for our test case to use variables, which is one of the features we’ve chosen Katalon for.
The reason for this is that our test cases need to be run individually, as well as a part of larger workflows. Consequently, they need to be parameterized in such a way that they can be run from a CSV, as well as via the Run Test Case action by other tests.
Your suggestion of embedding the test data into the test case seems like an anti-pattern, as it would require a lot of repeated boilerplate and reduce flexibility of the Katalon project. I’d rather better understand why test setup cannot occur before data binding, or if another hook could be added for this stage.