Forum Discussion

autoscout24's avatar
autoscout24
Contributor
14 years ago

Update testRequest parameter during runtime

What I would like to ask is the following,

The mandatory parameters of our test request is below.
<data&colon;vehicle>
<data&colon;body_colorgroup_id>${#TestCase#body_colorgroup_id}</data&colon;body_colorgroup_id>
<data&colon;category_id>${#TestCase#category_id}</data&colon;category_id>
<data&colon;fuel_type_id>${#TestCase#fuel_type_id}</data&colon;fuel_type_id>
<data&colon;initial_registration>${#TestCase#initial_registration}</data&colon;initial_registration>
<data&colon;kilowatt>${#TestCase#kilowatt}</data&colon;kilowatt>
<data&colon;mileage>${#TestCase#mileage}</data&colon;mileage>
<data&colon;prices>
<data&colon;price>
<data&colon;type>${#TestCase#prices_price_type}</data&colon;type>
<data&colon;value>${#TestCase#prices_price_value}</data&colon;value>
<data&colon;vat_type_id>${#TestCase#prices_price_vat_type_id}</data&colon;vat_type_id>
</data&colon;price>
</data&colon;prices>
<data&colon;brand_id>${#TestCase#brand_id}</data&colon;brand_id>
<data&colon;model_id>${#TestCase#model_id}</data&colon;model_id>
</data&colon;vehicle>


During run time we need to insert a new parameter of the above request some thing like below
<data&colon;vehicle>
<data&colon;body_colorgroup_id>${#TestCase#body_colorgroup_id}</data&colon;body_colorgroup_id>
<data&colon;category_id>${#TestCase#category_id}</data&colon;category_id>
<data&colon;consumption>
<data&colon;liquid>
<data&colon;combined>${#TestCase#consumption_liquid_combined}</data&colon;combined>
<data&colon;extra_urban>${#TestCase#consumption_liquid_extra_urban}</data&colon;extra_urban>
<data&colon;urban>${#TestCase#consumption_liquid_urban}</data&colon;urban>
</data&colon;liquid>
</data&colon;consumption>

<data&colon;fuel_type_id>${#TestCase#fuel_type_id}</data&colon;fuel_type_id>
<data&colon;initial_registration>${#TestCase#initial_registration}</data&colon;initial_registration>
<data&colon;kilowatt>${#TestCase#kilowatt}</data&colon;kilowatt>
<data&colon;mileage>${#TestCase#mileage}</data&colon;mileage>
<data&colon;prices>
<data&colon;price>
<data&colon;type>${#TestCase#prices_price_type}</data&colon;type>
<data&colon;value>${#TestCase#prices_price_value}</data&colon;value>
<data&colon;vat_type_id>${#TestCase#prices_price_vat_type_id}</data&colon;vat_type_id>
</data&colon;price>
</data&colon;prices>
<data&colon;brand_id>${#TestCase#brand_id}</data&colon;brand_id>
<data&colon;model_id>${#TestCase#model_id}</data&colon;model_id>
</data&colon;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&colon;vehicle>
<data&colon;body_colorgroup_id>${#TestCase#body_colorgroup_id}</data&colon;body_colorgroup_id>
<data&colon;category_id>${#TestCase#category_id}</data&colon;category_id>
<data&colon;fuel_type_id>${#TestCase#fuel_type_id}</data&colon;fuel_type_id>
<data&colon;gears>${#TestCase#gears}</data&colon;gears>
<data&colon;initial_registration>${#TestCase#initial_registration}</data&colon;initial_registration>
<data&colon;kilowatt>${#TestCase#kilowatt}</data&colon;kilowatt>
<data&colon;mileage>${#TestCase#mileage}</data&colon;mileage>
<data&colon;prices>
<data&colon;price>
<data&colon;type>${#TestCase#prices_price_type}</data&colon;type>
<data&colon;value>${#TestCase#prices_price_value}</data&colon;value>
<data&colon;vat_type_id>${#TestCase#prices_price_vat_type_id}</data&colon;vat_type_id>
</data&colon;price>
</data&colon;prices>
<data&colon;brand_id>${#TestCase#brand_id}</data&colon;brand_id>
<data&colon;model_id>${#TestCase#model_id}</data&colon;model_id>
</data&colon;vehicle>


Would be great, if you guys give us some suggestion.

Thank you

Regards
Vijay
No RepliesBe the first to reply