Forum Discussion

vaibhavk's avatar
vaibhavk
Occasional Contributor
7 years ago
Solved

How to verify if certain russian language text is present in SOAP UI Respone or not

the text i want to assert is "являются"which is in Russian language. the Contains assertion  doesnot work for this text. Can anyone suggest to verify this above text in the soap UI response?

  • PaulMS's avatar
    PaulMS
    7 years ago

    The document content is encoded within the json response.

    https://stackoverflow.com/questions/11145681/how-to-convert-a-string-with-unicode-encoding-to-a-string-of-letters

     

    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

12 Replies