How to escape ampersand in Property Expansion?
Hi,
In our TestCases, we use properties as values for SOAP requests in the following way:
<com:name>${#TestCase#currentName}</com:name>
This mostly works fine, but in some cases the property values contain an ampersand (&) character. This then leads to an incorrect XML and thus invalid SOAP Request:
<com:name>Fencing & Security</com:name>
The expected behaviour would be that SoapUI escapes the invalid character to create the following element:
<com:name>Fencing & Security</com:name>
When assigning the value to the element using a separate Property Transfer test step, this is correctly done (the value is escaped).
The problem is that we set all the properties using a Groovy Script before running the request, which makes using property expansion in the request by far the easiest way to assign all values.
Is there a way to use property-expansion that does escape special characters when used in XML?