Forum Discussion

gokulhari's avatar
14 years ago

How to resolve tag deletion in SOAPUI pro when left blank

-While passing empty tags in the request, during execution it removes the entire tag which is left blank and for the next iteration it is throwing an error in the response since the request is not correct.
-Currently we are doing Data Driven Testing, so for some iteration the field should be passed with values and for some iteration it should be left blank. While leaving blank it is removing the entire tag and then save the project and close SOAP UI Pro tool.
-So next time while importing the project the request structure is modified and not able to get the expected response.
-So because of the issue each time we need to create one request and have to give the input fields. Not able to perform the DDT in our case because of this issue.

Example:
Step1:Run with below request and save and close the project

<AddressLine1>State street</AddressLine1>
<City></City>
<State></State>

Step2: Import the project and the request structure will be in the below format.

<AddressLine1>State street</AddressLine1>
kindly suggest on this to overcome the issue, so that the request structure should remain same while importing the project after saving.
  • Jasper175's avatar
    Jasper175
    Frequent Contributor
    If you're manually entering in the data in your XML you'll have this problem.
    The way to keep the tag is populate each tag with a property value.
    I'm doing the same exact test type.
    You can either use TestSuite Properties (create the field names), or you can create Property file (as well create the field names)
    In my example I'm using the TestSuite properties.
    Then in the XML just right-click > Get Data > hover over TestSuite > Select the value.

    Your XML will look like this:
    <ser:billingAddress>
    <ser:addressLine1>${#TestSuite#addressLine1}</ser:addressLine1>
    <ser:addressFormat>Standard</ser:addressFormat>
    <ser:city>${#TestSuite#city}</ser:city>
    <ser:countryCode>${#TestSuite#country}</ser:countryCode>
    <ser:state>${#TestSuite#state}</ser:state>
    <ser:zipCode>${#TestSuite#zipCode}</ser:zipCode>
    </ser:billingAddress>

    This will keep the tag and send it blank if you keep your Property value blank.
    What you need to send in you'll have to now populate the Property instead of the XML.