Authentication Overhaul - Convert All Existing Tests

GambitGambit Posts: 28

My organization is overhauling how customer sign in is performed.

  • Currently a customer authenticates, then initiates a session which generates unique cookies that follow the customer as they navigate the website.
  • In the near future we will have two NEW endpoints to sign in, which will generate a token which will be used by the customer to navigate the website.

As you can imagine this will be a massive undertaking to manually update our existing .tst's to remove and replace the sign in tests, as well as update the headers for all test cases. So my question is: Is there a way to automate the conversion?


  • benken_parasoftbenken_parasoft Posts: 1,018 ✭✭✭

    It looks like you can search (and replace) HTTP header names and values using Parasoft Search (CTRL+H):

  • GambitGambit Posts: 28

    Hi Benken,

    I think this is what I'm looking for, but I can't get it to work.

    The search portion appears to be working as expected, finding all REST Clients containing HTTP Headers.

    But the replacement doesn't actually do anything. I'm guessing this is because the headers are different from test to test. Any suggestions?

  • GambitGambit Posts: 28

    I've been trying to follow the steps outlined in the documentation but it doesn't account for my particular situation so I'm totally blocked.

  • jakubiakjakubiak Posts: 739 admin

    It is working for me, with multiple REST Clients that contain different values for the same header. In the Parasoft Search, when you choose "HTTP Headers" and use the regular expression that you specified, it is finding both the header name and header value. So you will either need to specify a regular expression that only finds the header values, or you will need to manually select just the header values in the search results. Once I do that and I choose "Replace Selected..." or "Replace All...", the values do get updated for me. If the editor of the test is open when you do the replacement, the update will not be visible until you close and reopen the editor.

  • goofy78270goofy78270 Posts: 127

    Is there possibly a way to search 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 above 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.

  • GambitGambit Posts: 28

Sign In or Register to comment.