Unable to create XML dynamic request body using cheerio

I am not able to figure out how to add attribute values to Order & OrderLine tags. Any help is greatly appreciated

Sample XML

<?xml version="1.0" encoding="UTF-8"?>
<Order EMailID="" DocumentType="" EnteredBy="" OrderDate="" OrderNo=""PriorityCode="N">
    <Extn ExtnCheckoutType="GUEST"</Extn>
        <OrderLine CarrierCode="" DeliveryMethod=""</OrderLine>

Postman Pre-req Code

const dynamicBody= require('cheerio').load('',{
    ignoreWhitespace: true,
    xmlMode: true
dynamicBody.root().append('<?xml version="1.0" encoding="UTF-8"?>\n');
dynamicBody.root().append('<Order EMailID="'+pm.environment.get('emailID')+'"DocumentType="" EnteredBy="" OrderDate="" OrderNo="" PriorityCode="N">')

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.