How to remove empty nodes in JSON request during run time in soapui?
Hi Team,
I have implemented a data driven framework for a soap project for which inputs are fetched from an excel file. I have used 'Conditional Inline Property expansion using Ternary Operator' mechanism to remove empty nodes dynamically in soap xml. For example,
Assume, for my first case the request would look like in below format
<Add>
<intA>10</intA>
<intB>2</intB>
<intC>4</intC>
</Add>
and my for second case the request would be in below format
<Add>
<intA>10</intA>
<intB>2</intB>
</Add> , since my third node is empty in excel file it is automatically removed in the request (only for my second case).
Now I'm trying to achieve the same with JSON. Appreciate if anyone can help me in removing the empty JSON nodes dynamically.
Thanks
Hi giovanni_favara ,
Appreciate your help. But surprisingly, 'Conditional Inline Property Expansion using Ternary operator' rule itself is working here to remove empty object for REST project in Data-driven testing.
Below syntax for your quick reference
${=context.expand("${Properties#initA_Value}") != '' ? '"initA": ' + context.expand("${Properties#initA_Value}") + ',' : ''}
Thanks.