Forum Discussion

cdunne's avatar
cdunne
Contributor
18 years ago

Templated Xpath Assertion

Hi,

I currently template all my requests so I can read all my test cases and data in from a excel datasheet. In a corresponding worksheet I have the response data I supply to my XPath assertions. If I want to select the node for validation I must have a templated Response generated first. This is possible if I generate a simple mock service and run the Request against it.

I was wondering why corresponding Responses are not shown under the Response tab when a new Request is generated? Have I a setting that I need to set in order to see this information?

Thanks

Cormac

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Cormac,

    I'm not sure I quite follow.. the Response tab shows (or should show) the last response received for the corresponding request. It will be empty until you have submitted the request to your target service. Am I misunderstanding you here?

    regards!

    /Ole
    eviware.com
  • Hi Ole,

    I probably was not clear enough.

    The response tab shows the last response for a "submitted" request but I was thinking is it not possible to generate a dummy/templated response before you even submit the request? Exactly like you would get if you generated a mock response from the schema. This way you can create you XPath assertions before you need a respose returned.

    Cormac
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    ah, ok! Hmm.. what might be relatively easy is to generate a default-response in the xpath-selector (for the xpath-assertion) when there is no response available.. would that be a start?

    Alternatively we could add a "Generate Default Response" button/popup-action to the response editor, but this might be more work..

    would the first option above be ok to start with?

    regards!

    /Ole
    eviware.com
  • Hi Ole,

    Yeah the first option would be excellent. It would certainly make creating xpath assertions much easier.

    Thanks

    Cormac