Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract_binds usage help is appreciated #287

Open
imangohari1 opened this issue Aug 15, 2018 · 1 comment
Open

extract_binds usage help is appreciated #287

imangohari1 opened this issue Aug 15, 2018 · 1 comment

Comments

@imangohari1
Copy link

Hi,
I'm having the following ReST message:

HTTP/1.1 200 OK
Date: Mon, 06 Aug 2018 15:32:21 GMT
Content-Length: 90
Content-Type: text/plain; charset=utf-8

{"responseCode":0,"responseMsg":"Initiated","userId":4,"stackId":1,"stackResponseCode":0}

and I'm trying to use the extact_binds to get the value of stackId:

- test:
   - group: "CMT Test"
   - name: "Stack Creation"
   - url: "XXX"
   - method: 'POST'
   - body: 'XXXX'
   - expected_status: [200]
   - headers: {'Content-Type': 'text/plain'}
   - extract_binds:
       - 'id': {'raw_body': 'stackId'}
   - validators:
       - extract_test: {raw_body: "stackId",  test: "exists"}
       - compare: {raw_body: "stackId", comparator: contains , expected: '$id'}

Unfortunately I'm facing the following error:

ERROR:Test Failure, failure type: Validator Failed, Reason: Comparison failed, evaluating contains({"responseCode":0,"responseMsg":"Initiated","userId":4,"stackId":26,"stackResponseCode":0}
, $id) returned False

any help is appreciated!

@imangohari1
Copy link
Author

For anyone who is having this issue, please take a look at
~/pyresttest/examples/miniapp-extract-validate.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant