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

can response data with return 400/404/500 be verified #26

Closed
forumbyr opened this issue Mar 12, 2014 · 4 comments
Closed

can response data with return 400/404/500 be verified #26

forumbyr opened this issue Mar 12, 2014 · 4 comments

Comments

@forumbyr
Copy link

if response is 400/404/500, does response data support normal key words, eg : 'Should Contain' ?
I found it not supports now, it will fail soon if return status >=400 .
will you add this feature?
Thanks

@peritus
Copy link
Owner

peritus commented Mar 12, 2014

  1. You can use the 'Next Request ...' family of keywords (documented at http://peritus.github.io/robotframework-httplibrary/HttpLibrary.html) to make expectations about the next request. Making failing requests fail the test as a default is just a convenience, because most of the time that's what you want.
  2. You can the 'Get Response Status' keyword to get the response status code and then make your own assertions.

HTH

@peritus peritus closed this as completed Mar 12, 2014
@forumbyr
Copy link
Author

sorry for not seen this : Next Request May Not Succeed, and it works fine!
Thanks !

@forumbyr
Copy link
Author

I have another quersion:
does httplibrary support unicode ?
eg, test with :
GET /query?q=sälen
or:
GET /query?q=s中国
both will fail , error is :
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 30: ordinal not in range(128)
Thanks


and i found this :#21
maybe url also could be encoded before call http method?

@Swati3027
Copy link

How to get the response message of a 400 response?
suppose , i am getting a error msg - "xyz is not present" along with a 400 status code.
How can i fetch this message?

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

3 participants