Update literal headers all at once

goofy78270goofy78270 Posts: 108

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_parasoftbenken_parasoft Posts: 958 ✭✭✭

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

  • goofy78270goofy78270 Posts: 108

    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.

  • goofy78270goofy78270 Posts: 108

    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_parasoftbenken_parasoft Posts: 958 ✭✭✭
    edited January 29

    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).

Sign In or Register to comment.