I want to use a random xml generator tool in order to perform random testing by generating random xml files from xsd. ( I am using Oxygen tool)
The random generator will not apply semantic restrictions on the generated values. for example I have an element "parameters" that has multiple element "parameter" for example p1 and p2 , on the other hand I have another element "constraint" which will using "parameter". I mean if I have P1, P2 , it should use a subset of p1 and p2. I want to force the random generator tool to use them ( p1 and p2) instead of randomly generate some other parameters again for the constraint. I used "key", "keyref" and.. but still it doesnt work. it just generate random string everywhere with out any restrictions , I have to mention that I select the option "values of elements and attributes: Random (apply restrictions) " So it should consider the restriction when generating random values but it doesn't! please help..
SAMPLE of a valid XML:
<system>
<parameters>
<parameter id="1" name="p1" >
<value id="1" name="value1"/>
<value id="2" name="value2"/>
</parameter>
<parameter id="2" name="p2" >
<value id="1" name="value1"/>
<value id="2" name="value2"/>
</parameter>
</parameters>
<constraint text="p1=p2">
<parameter name="p1"/>
<parameter name="p2"/>
</constraint>
</system>
So I want the use subset of parameters that already generated (p1 and p2) ,as you can see in above example ,instead of generating some other random parameters because then all generated xmls are invalid and I want a valid one.
SAMPLE of a invalid XML:
<system>
<parameters>
<parameter id="1" name="p1" >
<value id="1" name="value1"/>
<value id="2" name="value2"/>
</parameter>
<parameter id="2" name="p2" >
<value id="1" name="value1"/>
<value id="2" name="value2"/>
</parameter>
</parameters>
<constraint text="**p3**=**p5**">
<parameter name="**p8**"/>
<parameter name="**p9**"/>
</constraint>
</system>
Thanks