Forum Discussion
I have written the below script
import groovy.json.JsonSlurper
def text ='являются'
def response = messageExchange.response.responseContent
assert response.contains("${text}")
log.info response.contains("${text}")
I am getting the error message as :- assert response.contains("${text}") | | | | false являются followed by remaining response.
But when I enter the Any english text in the above for eg. def text ="Mobile" which is present in the response the assertion gets Passed.
Kindly let me know how can I assert the являются text from the response.
I m new to soap UI
Can you copy the content from the response Raw tab in a reply?
Is the content type similar to this
Content-Type: application/json; charset=utf-8
- vaibhavk8 years agoOccasional Contributor
Yes , I have added the content type as Content-Type: application/json; charset=utf-8
I have also set the Encoding to UTF-8 in the properties
My Response in Raw is as below :-
HTTP/1.1 200 OK
Server: uproxy
Date: Wed, 29 Nov 2017 08:19:46 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.4.24
Set-Cookie: PHPSESSID=27mcbo7mnh0m43n34hk929h7v3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Access-Control-Allow-Headers: Ubi-AppId, Content-Type, boundary, If-Modified-Since
X-Cached: HIT{"document":{"name":"TestingQA-RU-Ru","url":"http:\/\/dev-legal.ubi.com\/prod\/TestingQARURu\/RU?languageCode=ru&format=html","version":"2.00","lastUpdate":"2017-11-24","type":"HTML","locale":"ru-RU","content":"<style>\n.loroman\n{\nlist-style-type: lower-roman;\n}\n\n.uproman\n{\nlist-style-type: upper-roman;\n}\n\n.loalpha\n{\nlist-style-type: lower-alpha;\n}\n\n.upalpha\n{\nlist-style-type: upper-alpha;\n}\n\n.circle\n{\nlist-style-type:circle;\n}\n<\/style>\n\r\n\r\n<p>Update Russia 1 Ubisoft Entertainment SA, Ubisoft EMEA SAS, Ubisoft, Inc., Ubisoft Mobile Games, Red Storm Entertainment, Inc., Blue Byte GmbH \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 Ubisoft (\u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u2013 \u00abUbisoft\u00bb \u0438\u043b\u0438 \u00ab\u043c\u044b\u00bb).<\/p>\r\n\r\n<p>\u041c\u044b \u0443\u0432\u0430\u0436\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0442\u0430\u0439\u043d\u0443 \u0438 \u043d\u0435\u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043b\u0438\u0447\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043b\u0438\u0446, \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043e\u043d\u043b\u0430\u0439\u043d \u0443\u0441\u043b\u0443\u0433\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Ubisoft, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0421\u0430\u0439\u0442\u043e\u0432, \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0438\u0433\u0440, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u0438\u043d\u044b\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0421\u0430\u0439\u0442\u043e\u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c \u0438\u0445 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\r\n\r\n<p>\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Ubisoft \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u044b, \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440\u044b, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b (\u0434\u0430\u043b\u0435\u0435 - \u00ab\u0421\u0435\u0440\u0432\u0438\u0441\u044b\u00bb) \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Ubisoft, \u043b\u0438\u0431\u043e \u043f\u043e \u0438\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u043d\u0430\u043c\u0438 \u043e\u043d\u043b\u0430\u0439\u043d.<\/p>\r\n\r\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0438\u043b\u0438 \u0421\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438; \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c; \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u0438\u043b\u0438 \u0421\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u0438 \u043e \u0432\u0430\u0448\u0435\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438; \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u0430\u0435\u0442\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0435 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438; \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0432\u0430\u0448\u0438 \u043f\u0438\u0441\u044c\u043c\u0430. <\/p>\r\n\r\n<p>\u041c\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438 \u0437\u0430\u0449\u0438\u0442\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u0430\u043b\u0435\u0435 \u2013 \u00ab\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430\u00bb), \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c: \u043a\u0430\u043a \u0438 \u043d\u0430 \u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c, \u0445\u0440\u0430\u043d\u0438\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438 \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0430\u0448\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\r\n\r\n<p>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u041a\u043e\u043d\u0432\u0435\u043d\u0446\u0438\u0435\u0439 \u0421\u043e\u0432\u0435\u0442\u0430 \u0415\u0432\u0440\u043e\u043f\u044b \u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b\u043c \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c.<\/p>\r\n\r\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0421\u0435\u0440\u0432\u0438\u0441\u0430\u043c Ubisoft \u0438 \u043d\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0421\u0435\u0440\u0432\u0438\u0441\u044b Ubisoft \u043c\u043e\u0433\u0443\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c Ubisoft \u043d\u0435 \u043d\u0435\u0441\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0412\u0430\u043c\u0438 \u043d\u0430 \u0421\u0435\u0440\u0432\u0438\u0441\u0430\u0445 Ubisoft \u0432 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u0441\u0442\u0440\u0430\u0
- PaulMS8 years agoSuper Contributor
The document content is encoded within the json response.
You can use contains assertion with the unicode content
\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f
or script assertion to convert from unicode
import groovy.json.JsonSlurper
def text ='являются'
def response = messageExchange.response.responseContent
def jsonSlurper = new JsonSlurper().parseText(response)
content = jsonSlurper.document.content
assert content.contains("${text}")
log.info content- vaibhavk8 years agoOccasional Contributor
Thank you very much for help. it is working now