Forum Discussion

Defender's avatar
Defender
Contributor
16 years ago

Improve assertions

I sure it would be great to add the ability to access raw responses for the REST requests (at least for "contains" assertions) for assertions. It would be great if some header parser will be present for this. Main tasks: get the header's value, get request status code etc. Now it is possible for script assertions only - only xml responses are processed by "Contains", XQuery & XPath assertions.

2 Replies

  • Hello,

    You can access to headers in script assertion with

    context.currentStep.getHttpRequest().getResponse().properties["responseHeaders"]


    as a hash map. You can use this. Anyway will be looking into your suggestion, thanks.

    robert
  • Hello Robert,

    Thanks for your help!

    Script assertions resolves the problem but I sure making assertions more powerful can greatly simplify the project