Hello all,
I've been having some issues with how to replace a variable appearing within test data. Let me explain. I am running tests data driven and lets say I have 2 test cases. One does something and returns an 'id'. This 'id' is then used by the 2nd test case to add another entry. Such dependency is currently unavoidable since the 'id' generated is unique each time and TestCase2 depends on it.
Currently when running testcase1 I get back an 'id' which I set as a suite variable. And then testcase2 uses this 'id' variable thus set. This works if the data is hardcoded into the test case. But when the data is abstracted into a test data file I dont know how to replace the '${id} in the test data.
As an example.
TestCase2 reads data from the file like this.
{"name":"some name", "previous id":${id}"}
What I would like to find out is 1. How to replace the ${id} with suite variable that I set after running TestCase1?
2. In another scenario, if I were to pass ${id} to TestCase2 as an argument how do I get it to replace the ${id} field in the test case data?
Both answers both be great appreciated. Thank you.