cdunne
18 years agoContributor
Dynamic Templated Tests
Hi,
I have a data source where every row represents and holds test data for a particular test case. This data is then looped through a templated request.
I have come across the following issue, one of my templates can be generated in 2 different ways, for example the following method must be generated with only 1 of a choice of 2 elements.
"Blah"
or
"Blah"
The only way I can see round this is to have 2 separate templated scenarios for the same request, either ran in two spearte testcases or teh same test case. I don't really want to split the datasource in two or try to manage the order in which the test case data is populated in either.
I would prefer to keep all the logic with in the test case, so if a Msisdn field in the datasource is populated execute scenario 1 or if the Imsi field is populated, execute scenario 2. Is it possible to dynamically generate templated requests or select which request to run within a test case, based upon a supplied property.
Has anyone tried anything like this before or is it even possible?
Cormac
I have a data source where every row represents and holds test data for a particular test case. This data is then looped through a templated request.
I have come across the following issue, one of my templates can be generated in 2 different ways, for example the following method must be generated with only 1 of a choice of 2 elements.
or
The only way I can see round this is to have 2 separate templated scenarios for the same request, either ran in two spearte testcases or teh same test case. I don't really want to split the datasource in two or try to manage the order in which the test case data is populated in either.
I would prefer to keep all the logic with in the test case, so if a Msisdn field in the datasource is populated execute scenario 1 or if the Imsi field is populated, execute scenario 2. Is it possible to dynamically generate templated requests or select which request to run within a test case, based upon a supplied property.
Has anyone tried anything like this before or is it even possible?
Cormac