ISSUE: header values translating variables in part.

goofy78270goofy78270 Posts: 89

I recently have run into the following issue where I set a variable in a pre-req (previous) call and then use the value in the header of subsequent calls. Lately, it appears as though 1 value is translated in a header, but the second value is not.

initial header with variables:
Cookie: authcookie=authorized; sessionid=${db_sessionid}; XSRF-TOKEN=${db_xsrf_token}; _t=${db_t}
X-SESSION: ${db_sessionid}
X-XSRF-TOKEN: ${db_xsrf_token}

resulting translated header:
Cookie: authcookie=authorized; sessionid=${db_sessionid}; XSRF-TOKEN=${db_xsrf_token}; _t=${db_t}
X-SESSION: 348f9009-321b-4dad-9c67-fc687656c6a5
X-XSRF-TOKEN: 114efe4171d82d9f

Has anyone else come across this issue? Any ideas on the possible cause?

Comments

  • benken_parasoftbenken_parasoft Posts: 890 ✭✭✭

    If you are seeing variables not getting resolved then it is likely the case that those variables are not getting set in the fist place. For example, if you are using a Data Bank tool to extract a value and copy it into a variable or data bank column then you should verify that your extraction is setup correctly.

  • goofy78270goofy78270 Posts: 89

    They are being set as you can see the single lines are being translated, just not the line for the cookie. They are the same variable in both places...I even copied and pasted to ensure I there were no spelling mistakes.

  • benken_parasoftbenken_parasoft Posts: 890 ✭✭✭

    Can you describe your test setup a bit more? Are you configuring REST Client tools for each of your calls? I wasn't able to reproduce the behavior you describe.

  • goofy78270goofy78270 Posts: 89

    it appears as though the update for the cookie field is an all or nothing field, meaning if 1 variable is not available, none of the variables in the statement get updated. Since db_t is not used in some scenarios, the entire cookie was not updated rather than translation in part, as I was expecting: Cookie: authcookie=authorized; sessionid=348f9009-321b-4dad-9c67-fc687656c6a5; XSRF-TOKEN=114efe4171d82d9f; _t=${db_t}

Sign In or Register to comment.