Forum Discussion

RJanecek's avatar
RJanecek
Regular Contributor
16 years ago

dissapearing elements

Hi, I have one problem. When I write to the element some spaces for example:
<a> </a> and then run test everything works. (I am testing when there are spaces in element it throws soapfault) . But when I save this project and close this teststep and open it again this elements dissapear !!!! Why it dissapear I think this is big bug and I cant test my application

PS: sorry for mistake. My english is quite bad

5 Replies

  • Hello,

    Can you be a bit more specific regarding your problem? Where are you writing the "<a> </a>", is it in the XML body of a SOAP request? Maybe you can take some screenshots, showing what it looks like with the elements, and then again after re-opening the TestStep when the elements are gone.

    Regards,
    Dain
    eviware.com
  • Hello,

    This is the behavior of the editor, empty values which are not required will be removed. As a workaround you would put a Property Expansion as the value, which evaluates to an empty String, for example: <a>${empty}</a> This will prevent the editor from removing the element, but since there is no Property with this name, an empty value will be substituted.

    Regards,
    Dain
    eviware.com
  • Kochubyey's avatar
    Kochubyey
    New Contributor
    Hi,

    I believe there is a good reason for removing empty Optional Elements from Request XML when you delete value in a Form View. And it is very good reason that for Requred elements it does not remove element tag from XML but makes only text value empty.

    The confusing thing that there is no indication on Form View if empty field is present or deleted in XML request.

    I would like to request a fix in Form View to show that element does not exist in XML (for example show element name greyed out)

    Some time I need to check that required field element is removed from xml request and response fails with correct error message. However Form View does not show if element present or just empty in XML.

    1. Please at least make it clear if tag is in XML or not (by different color or some icon or some other mark)
    2. If it is possible add ability to delete tag from Form View even if is required fied.

    Another (alternative) way to solve this issue is to set cursor focus in XML view to the corresponding current posion of Form View element. So when you select field in Form View and then select XML view tab cursor is placed on the same tag if it exists or in between of tags where it soppose to be. This way can not just delete current selected tag in form view but also read comments around this tag or copy and paste element name for same reasons. Inability to copy paste field/method names from Form View is not very important but not very nice. So if jump to XML view will place cursor in the same possion it was on Form View will be a simple and very usable feature.

    Please let me know if I need to create another topic for this requests?

    Thanks,
    Kyrylo
  • I disagree that the automatic removal of empty elements is good.
    We have a method that is updating a record with the value in an element (including clearing the field in the record if the element is empty), but leaves the value in the record unchanged if the element has been omitted.
    For now, to test clearing the value in the record we have used the suggestion of putting ${empty} as the value on the Form which stops the element being omitted but sends an empty element as the property 'empty' does not exist.
    However, I think that the Form window would be better to not only show whether an element has been omitted or not (as suggested in the previous post), but further to also allow the user to indicate whether they want the element omitted, rather than SoapUI doing this automatically.