# Compare Two Text response on Postman

**URL:** <https://community.postman.com/t/compare-two-text-response-on-postman/32604>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [February 15, 2022, 9:55am UTC](https://community.postman.com/t/compare-two-text-response-on-postman/32604 "2022-02-15T09:55:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![automationQA](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@automationQA](https://community.postman.com/u/automationQA)\
**Post date:** [February 15, 2022, 9:55am UTC](https://community.postman.com/t/compare-two-text-response-on-postman/32604/1 "2022-02-15T09:55:33Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_My question_:  
Hi,  
Can you help me please.  
I have to compare response (not json response) on postman for example (text response ..) with another text

_Details (like screenshots)_:  
1rst request is to post this “text”  
2end request is to get this “text”

=\> how can i compare if this two text(csv file) or two record .. are the same.

Thanks 🙂

_How I found the problem_:

_I’ve already tried_:

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [February 15, 2022, 9:59am UTC](https://community.postman.com/t/compare-two-text-response-on-postman/32604/2 "2022-02-15T09:59:50Z")

</div>

Hi @automationQA

There is a good example of this here:

> [@Test if entire HTML response is equal to expected HTML](https://community.postman.com/t/test-if-entire-html-response-is-equal-to-expected-html/32588):
>
> We have an API that returns HTML and want to write tests to validate that the HTML being returned is valid. We are not trying to parse the HTML, just do a direct comparison. Based on similar tests we created for JSON responses, we hoped something like this would work const body = pm.response.text(); pm.test("check text body", function() { pm.expect(body).to.eql( { \<html\> \<body\> My expected text here... \</body\> \</html\> } ); }); We get a syntax error: unexpected token ‘\<’

---

<div class="post-metadata">

**Author:** ![automationQA](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@automationQA](https://community.postman.com/u/automationQA)\
**Post date:** [February 17, 2022, 1:05pm UTC](https://community.postman.com/t/compare-two-text-response-on-postman/32604/3 "2022-02-17T13:05:10Z")

</div>

Thank u @w4dd325 , it’s working when comparing text, but it’s not working for mp3 file … but i found solution i will compare by size =\> to be sure that audio is the same
