Hi, I would like to validate the values of XML parameters but I faced some issues.
<VHBTV_CD:MediaAttributes>
<VHBTV_CD:MediaTrack>
<VHBTV_CD:SubTitle impairedHearing="true">FRE</VHBTV_CD:SubTitle>
</VHBTV_CD:MediaTrack>
</VHBTV_CD:MediaAttributes>
I can only validate the value of an attribute impairedHearing:
pm.expect(jsonObject[âVHBTV_GRIDâ][âContentLocationTableâ][âTVContentLocationâ][âVHBTV_TV:AVAttributesâ] [âVHBTV_CD:MediaAttributesâ][âVHBTV_CD:MediaTrackâ][âVHBTV_CD:SubTitleâ].$[âimpairedHearingâ]).to.eql(âtrueâ);
I try to find out how to validate âSubTitleâ itself, so I print it to the console:
console.log(jsonObject[âVHBTV_GRIDâ][âContentLocationTableâ][âTVContentLocationâ][âVHBTV_TV:AVAttributesâ][âVHBTV_CD:MediaAttributesâ][âVHBTV_CD:MediaTrackâ][âVHBTV_CD:SubTitleâ])
- {_: âFREâ, $: {âŠ}}
-
_: âFREâ
-
$: {âŠ}
-
impairedHearing: âtrueâ
The issue is related with {: âFREâ, $: {âŠ}} - I have no idea how to deal with ':â
To sum up. I know how to validate the attribute but really donât know how to validate the language of the subtitle.
Similar situation with genre:
<VHBTV_CD:GenreList>
<VHBTV_CD:Genre genreLabel=âEnfant - sĂ©rieâ>BFT-003-005</VHBTV_CD:Genre>
</VHBTV_CD:GenreList>
I am able to validate the genreLabel:
pm.expect(jsonObject[âVHBTV_GRIDâ][âContentTableâ][âVHBTV_CD:Contentâ][âVHBTV_CD:GenreListâ] [âVHBTV_CD:Genreâ].$[âgenreLabelâ]).to.eql(âEnfant - sĂ©rieâ);
but no idea how to check the value of VHBTV_CD:Genre.
console.log(jsonObject[âVHBTV_GRIDâ][âContentTableâ][âVHBTV_CD:Contentâ][âVHBTV_CD:GenreListâ] [âVHBTV_CD:Genreâ])
Thank you in advance for any tips