Search code examples
testinghp-uftweb-api-testing

Save Web Service Response as XML


I'm working with HP UFT nad HP ALM. I'm trying to save a web service response as xml in an API-Test. I found many tutorials to save a response in an Excel but it's not what I want.

Is this possible? If not, is it possible to download an .wsdl response?

API-Test construction

  1. Control if there exist an specific xml file(refernce.xml) on my computer
  2. If not then stop the test/if the reference.xml exist then keep going
  3. Now I want to save the response
  4. Compare the 2 files(reference.xml and downloaded xml)

Solution

  • In Api Tests/Components you can do this by simply using the standard activities available.

    In the Toolbox menu, under 'Standard Activities' expand the 'File' list and add the 'Write to File' activity to your flow. Then, in the Input/Checkpoints tab of the activity you can set the export path (in the path you should include the name.xml file that will be generated) and the content (for the content you can select the main tag of the response, that holds all the content : for example).

    enter image description here

    https://community.hpe.com/t5/Unified-Functional-Testing/UFT-API-Save-Response-as-xml/td-p/6867566