Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to verify content of Response Header contains a given string

I have a REST API call that returns the following in the Response Header:
Content-Disposition: attachment; filename=cmdownloads.zip
I need to verify that the filename is "cmdownloads.zip" (in this case).
I captured the Header in a Header Bank but am unsure what to do next. I have tried converting it to XML and think I should be able to use an assertor with a regular expression assertion but am unsure of the exact syntax.
Suggestions?

Best Answer

  • VirtualUser
    VirtualUser Posts: 15
    Answer ✓

    Sure, right-click on test client, Add Output...
    Select Response\Transport Header and then Search Tool from the tools pane

Answers

  • VirtualUser
    VirtualUser Posts: 15

    Hi,

    You could add a Search Tool (with the expected filename as a search term) to Response\Transport Header.

  • amckernon
    amckernon Posts: 4

    Sorry I am not an advanced user, can you give me specific steps for how to do that? I haven't run into a Search Tool yet.

  • amckernon
    amckernon Posts: 4

    Oh, I found it! It seems to have worked too, thanks very much.

  • VirtualUser
    VirtualUser Posts: 15

    happy it worked!