How to access RestTest Header Values from Traffic view Objects

I am new to this forum and I really need help. I have 100 + rest test cases in my suite and I need to retrieve header value from Traffic Viewer Objects for Each Test Cases. Would you please give me a code for this?


  • OmarROmarR Posts: 214 admin


    You could use a Header DataBank, Text databank, or REST URL databank to extract the desired response header values.
    1) Add an output tool to your REST client
    2) Select Response> Transport Header and choose the desired databank.

    3) Run the tool and verify that the databank is populated with information.

    Unfortunately, you would need to do this for all your REST clients. If the desire is to do this for all tests in a single run, you could run your clients through a VIRTUALIZE proxy and extract the headers along the way in a single run, but that may be a little more work :#

  • benken_parasoftbenken_parasoft Posts: 721 ✭✭✭

    Why do you need to "retrieve header value"? If this is for validation, then you can diff the response header (with Diff tool). You only would use a Data Bank if you need to reuse the extracted header value as input to another test case.

  • Thank you for your email and I am looking for code to get the request header value from Traffic viewer Object for my rest clients in my suite.

  • benken_parasoftbenken_parasoft Posts: 721 ✭✭✭

    Use the Header Data Bank to extract header values. You chain this to the "Response Transport Header" output.

  • Thanks for your message and Instead of using header bank. Would you please provide code..

  • benken_parasoftbenken_parasoft Posts: 721 ✭✭✭

    Can you please clarify why you are looking to write code? Is there some reason why you can't use a Header Data Bank like Omar described in his earlier comment? Omar provided quite a bit of detail, including screenshots.

Sign In or Register to comment.