Forum Discussion

MartinS's avatar
MartinS
Occasional Contributor
14 years ago

Validating response from test request

Hello.

I am looking for a way to make a assertion which will validate my response data with my excel sheet. I have project where i have data source(data from excel) -> test request -> data sink(importing data to excel) -> loop. I want to make a assertion which takes data from excel(a lot of different data in 1 column) and validate them with response i got from test request. If you know how to do that then share your mighty wisdom with me please!
  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    Hi Martin,

    Since you need an assertion which asserts the response you get from an expected response in the excel sheet, you need to read that expected response first from an excel sheet. I would suggest dedicate some columns in your input sheet which is acting as data source for expected results itself, that way, you won't have to declare two different data source steps. Next move the expected results to different properties using a property transfer test step. Once you have these properties set, you can use a groovy assertion or probably xpath assertion to check the response with that of the properties. Your test case should now look like this:

    data source(data from excel) -> Property transfer -> Properties -> test request -> data sink(importing data to excel) -> loop.

    You don't need to transfer the source properties in your request if you don't need to. You should be able to populate your request still the same way you currently have.

    Let me know if this works.

    Regards,
    Deepesh Jain
  • MartinS's avatar
    MartinS
    Occasional Contributor
    deepesh.jain wrote:
    Hi Martin,

    Since you need an assertion which asserts the response you get from an expected response in the excel sheet, you need to read that expected response first from an excel sheet. I would suggest dedicate some columns in your input sheet which is acting as data source for expected results itself, that way, you won't have to declare two different data source steps. Next move the expected results to different properties using a property transfer test step. Once you have these properties set, you can use a groovy assertion or probably xpath assertion to check the response with that of the properties. Your test case should now look like this:

    data source(data from excel) -> Property transfer -> Properties -> test request -> data sink(importing data to excel) -> loop.

    You don't need to transfer the source properties in your request if you don't need to. You should be able to populate your request still the same way you currently have.

    Let me know if this works.

    Regards,
    Deepesh Jain


    Hi Jain,

    it works! I totaly forgot that this is a way to put it in input sheet and read it with as response data . Thanks for help

    Regards,
    Martin