# Testing. How to find 2 different texts in different responses

**URL:** <https://community.postman.com/t/testing-how-to-find-2-different-texts-in-different-responses/2173>\
**Category:** Help Hub\
**Created:** [July 28, 2018, 4:51pm UTC](https://community.postman.com/t/testing-how-to-find-2-different-texts-in-different-responses/2173 "2018-07-28T16:51:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viktor.Sergienko](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@Viktor.Sergienko](https://community.postman.com/u/Viktor.Sergienko)\
**Post date:** [July 28, 2018, 4:51pm UTC](https://community.postman.com/t/testing-how-to-find-2-different-texts-in-different-responses/2173/1 "2018-07-28T16:51:08Z")

</div>

Hello! I need help. I have an API request and I have 2 positive responses with different texts inside. I want to make 1 test for both variants. for example:  
pm.test(“Body matches text1 or text2”, function () {  
pm.expect(pm.response.text()).to.include(“text1” | “text2”);  
});  
Unfortunatly, it doesn’t work for both variants. Can you suggest a decision?

---

<div class="post-metadata">

**Author:** ![singhsivcan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/singhsivcan/32/1595_2.png) [@singhsivcan](https://community.postman.com/u/singhsivcan)\
**Post date:** [July 29, 2018, 11:08am UTC](https://community.postman.com/t/testing-how-to-find-2-different-texts-in-different-responses/2173/2 "2018-07-29T11:08:20Z")

</div>

@Viktor.Sergienko Instead of comparing them like that, you can use _lodash_  
Put the following in your test script:

```javascript
var _ = require('lodash');

pm.test("Body matches text1 or text2", function() {
    let body = pm.response.text(),
        includesText = _.includes(body, "text1") || _.includes(body, "text2");

    pm.expect(includesText).to.be.true;
});

```
