Forum Discussion

minu_cet's avatar
minu_cet
Occasional Contributor
7 years ago

SOAPUI XML format issue

Hi,

Using SOAPUI 5.3.0 version

 

Issue 1

In the Test Suite added Assertion "Contains"and provided value

"<StatusMessage>Create Quote Request initiated.</StatusMessage>".

Then I read this SOAPUI Project XML for further automation of these Test Suites.

SOAP UI XML is not in valid format as see ">" was not converted into correct format i.e "&gt;"

<con:configuration><token>&lt;StatusMessage>Create Quote Request initiated.&lt;/StatusMessage></token>

 

Issue 2

Added a step "Property Transfer" added 3 XPath transfers but in XML "type" tag is missing from first two transfers but present for third transfer 

 

 

<con:testStep type="transfer" name="Property Transfer" id="199394a8-d60e-46fb-ac53-7f7c63a79d33">
<con:settings/><con:config xsi:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="" ignoreEmpty="false" transferToAll="false" entitize="false" transferChildNodes="false"><con:name>contractnumber1</con:name><con:sourceType>ResponseAsXml</con:sourceType><con:sourceStep>JDBC Request</con:sourceStep><con:sourcePath>//*:Row[1]/*:RENEWED_QUOTE_NUMBER</con:sourcePath><con:targetType>Request</con:targetType><con:targetStep>Create Quote Request</con:targetStep><con:targetPath>declare namespace quot="http://www.vmware.com/it/mw/QuoteDetailsBSM";
//quot:ContractDetails/quot:ContractList/quot:Contract/quot:ContractNumber</con:targetPath><con:upgraded>true</con:upgraded></con:transfers>

 

<con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="" ignoreEmpty="false" transferToAll="false" entitize="false" transferChildNodes="false"><con:name>contractnumber3</con:name><con:sourceType>ResponseAsXml</con:sourceType><con:sourceStep>JDBC Request</con:sourceStep><con:sourcePath>//*:Row[2]/*:RENEWED_QUOTE_NUMBER</con:sourcePath><con:targetType>Request</con:targetType><con:targetStep>Consolidation Quote Request</con:targetStep><con:targetPath>declare namespace quot="http://www.vmware.com/it/mw/QuoteDetailsBSM";
//quot:ContractDetails/quot:ContractList/quot:Contract[2]/quot:ContractNumber</con:targetPath><con:upgraded>true</con:upgraded></con:transfers>

 

<con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="" disabled="false" entitize="false" ignoreEmpty="false" transferChildNodes="false" transferToAll="false" useXQuery="false"><con:name>contractnumber2</con:name><con:sourceType>ResponseAsXml</con:sourceType><con:sourceStep>JDBC Request</con:sourceStep><con:sourcePath>//*:Row[2]/*:RENEWED_QUOTE_NUMBER</con:sourcePath><con:targetType>Request</con:targetType><con:targetStep>Consolidation Quote Request</con:targetStep><con:targetPath>declare namespace quot="http://www.vmware.com/it/mw/QuoteDetailsBSM";
//quot:ContractDetails/quot:ContractList/quot:Contract[1]/quot:ContractNumber</con:targetPath><con:type>XPATH</con:type><con:targetTransferType>XPATH</con:targetTransferType><con:upgraded>true</con:upgraded></con:transfers></con:config></con:testStep>

 

 

1 Reply

  • PaulMS's avatar
    PaulMS
    Super Contributor

    Hi,

     

    I don't think it is necessary to replace > with &gt; in the XML file. The contains assertion should still work correctly.

     

    Only < and & are strictly illegal in XML, but it is a good habit to replace > with &gt; as well.

    https://www.w3schools.com/xml/xml_syntax.asp

     

    <con:type>XPATH</con:type> would be included in a property transfer if you select the language from the drop down list. However XPath should be the default option even if not selected from the list so the property transfer should still work correctly.