autoscout24
14 years agoContributor
Update testRequest parameter during runtime
What I would like to ask is the following,
The mandatory parameters of our test request is below.
During run time we need to insert a new parameter of the above request some thing like below
Similarly I have to loop the testcase with different set of parameter to the mandatory test request(is always constant). The location of the newly added parameter will also vary eg. in the above request 'consumption' is next to the category_id, if I use 'gears' then it should be next to 'fuel_type_id'.
Every time when a new parameter is added, we have to remove the old parameter, the request should like below.
Would be great, if you guys give us some suggestion.
Thank you
Regards
Vijay
The mandatory parameters of our test request is below.
<data:vehicle>
<data:body_colorgroup_id>${#TestCase#body_colorgroup_id}</data:body_colorgroup_id>
<data:category_id>${#TestCase#category_id}</data:category_id>
<data:fuel_type_id>${#TestCase#fuel_type_id}</data:fuel_type_id>
<data:initial_registration>${#TestCase#initial_registration}</data:initial_registration>
<data:kilowatt>${#TestCase#kilowatt}</data:kilowatt>
<data:mileage>${#TestCase#mileage}</data:mileage>
<data:prices>
<data:price>
<data:type>${#TestCase#prices_price_type}</data:type>
<data:value>${#TestCase#prices_price_value}</data:value>
<data:vat_type_id>${#TestCase#prices_price_vat_type_id}</data:vat_type_id>
</data:price>
</data:prices>
<data:brand_id>${#TestCase#brand_id}</data:brand_id>
<data:model_id>${#TestCase#model_id}</data:model_id>
</data:vehicle>
During run time we need to insert a new parameter of the above request some thing like below
<data:vehicle>
<data:body_colorgroup_id>${#TestCase#body_colorgroup_id}</data:body_colorgroup_id>
<data:category_id>${#TestCase#category_id}</data:category_id>
<data:consumption>
<data:liquid>
<data:combined>${#TestCase#consumption_liquid_combined}</data:combined>
<data:extra_urban>${#TestCase#consumption_liquid_extra_urban}</data:extra_urban>
<data:urban>${#TestCase#consumption_liquid_urban}</data:urban>
</data:liquid>
</data:consumption>
<data:fuel_type_id>${#TestCase#fuel_type_id}</data:fuel_type_id>
<data:initial_registration>${#TestCase#initial_registration}</data:initial_registration>
<data:kilowatt>${#TestCase#kilowatt}</data:kilowatt>
<data:mileage>${#TestCase#mileage}</data:mileage>
<data:prices>
<data:price>
<data:type>${#TestCase#prices_price_type}</data:type>
<data:value>${#TestCase#prices_price_value}</data:value>
<data:vat_type_id>${#TestCase#prices_price_vat_type_id}</data:vat_type_id>
</data:price>
</data:prices>
<data:brand_id>${#TestCase#brand_id}</data:brand_id>
<data:model_id>${#TestCase#model_id}</data:model_id>
</data:vehicle>
Similarly I have to loop the testcase with different set of parameter to the mandatory test request(is always constant). The location of the newly added parameter will also vary eg. in the above request 'consumption' is next to the category_id, if I use 'gears' then it should be next to 'fuel_type_id'.
Every time when a new parameter is added, we have to remove the old parameter, the request should like below.
<data:vehicle>
<data:body_colorgroup_id>${#TestCase#body_colorgroup_id}</data:body_colorgroup_id>
<data:category_id>${#TestCase#category_id}</data:category_id>
<data:fuel_type_id>${#TestCase#fuel_type_id}</data:fuel_type_id>
<data:gears>${#TestCase#gears}</data:gears>
<data:initial_registration>${#TestCase#initial_registration}</data:initial_registration>
<data:kilowatt>${#TestCase#kilowatt}</data:kilowatt>
<data:mileage>${#TestCase#mileage}</data:mileage>
<data:prices>
<data:price>
<data:type>${#TestCase#prices_price_type}</data:type>
<data:value>${#TestCase#prices_price_value}</data:value>
<data:vat_type_id>${#TestCase#prices_price_vat_type_id}</data:vat_type_id>
</data:price>
</data:prices>
<data:brand_id>${#TestCase#brand_id}</data:brand_id>
<data:model_id>${#TestCase#model_id}</data:model_id>
</data:vehicle>
Would be great, if you guys give us some suggestion.
Thank you
Regards
Vijay