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.

Update literal headers all at once

goofy78270
goofy78270 Posts: 133

Originally posted here, but as a part to a different question so re-posting for visibility of the issue itself.

Is there possibly a way to search and update the Literal HTTP Headers? I did not see such an option, but thought it would be a great addition if not.

I believe the issue with the current HTTP Header option is due to the headers being replaced are not 1 to 1 so each Name and Value has to be manually evaluated and changed.

Plus there does not appear to be a way to remove or add a header using the current HTTP Headers field type in search. Querying the literal header fields would allow such changes.

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    In case this helps, see my reply in this other thread which details how to update HTTP headers
    Authentication Overhaul - Convert All Existing Tests

  • goofy78270
    goofy78270 Posts: 133

    Sorry, that was the original post I should have included in the first post.

    However, as I mentioned, that method does not appear to allow the ability to add or remove headers although I guess replacing with an empty value would be removing. Still unsure how you would add as leaving the search field blank, did not work for me.

  • goofy78270
    goofy78270 Posts: 133

    I tired to use variables as a work around

    but after saving the values, :'s are inserted at the end of each line

    which results in headers like:
    header1: headervalue1:
    header2: headervalue2:

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited January 2021

    The Literal view can be thought of as a rendering of the Table view, where it is really the Table view that stores the data, storing the name and value of each header independently. That's why "Parasoft Search" searches the fields independently (that's how the data is stored).

    If you need to add a header then you must add it manually. However, an alternative might be to write a script that uses SOAtest's REST API to modify the tests in your workspace, adding the header you want to add (docs).