# Postman OR / to.be.oneOf Issue

**URL:** <https://community.postman.com/t/postman-or-to-be-oneof-issue/14617>\
**Category:** Help Hub\
**Created:** [July 30, 2020, 9:23am UTC](https://community.postman.com/t/postman-or-to-be-oneof-issue/14617 "2020-07-30T09:23:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JBird20](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@JBird20](https://community.postman.com/u/JBird20)\
**Post date:** [July 30, 2020, 9:23am UTC](https://community.postman.com/t/postman-or-to-be-oneof-issue/14617/1 "2020-07-30T09:23:57Z")

</div>

Hi All,

Can anyone help me with an issue i am having please?

After i have hit an endpoint, the response body will render some HTML.

Inside the Test tab i am running

```
pm.test("Confirm Expected Item Details are on Page : X", function(){

pm.expect(pm.response.text()).to.include("itemA");

});

```

However, i wanted to do an OR like statement, and item can change at different points so could be itemA, itemB or itemC.

So i did some googling, and have still come up short. I’ve tried:

```
pm.test("Confirm Expected Item Details are on Page : X", function(){

pm.expect(pm.response.text()).to.include.oneOf(['itemA','itemB']);

});

pm.test("Confirm Expected Item Details are on Page : X", function(){

pm.expect(pm.response.text()).to.include("itemA") || pm.response.text()).to.include("itemb");

});

```

None of these work. What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [July 30, 2020, 6:53pm UTC](https://community.postman.com/t/postman-or-to-be-oneof-issue/14617/2 "2020-07-30T18:53:12Z")

</div>

Since these tests are just running javascript, you could change it up a bit to the following:

```javascript
const responseText = pm.response.text();
const hasItemDetails = (responseText.includes('itemA') || responseText.includes('itemB'));

pm.expect(hasItemDetails).to.be.true;

```

---

<div class="post-metadata">

**Author:** ![JBird20](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@JBird20](https://community.postman.com/u/JBird20)\
**Post date:** [August 3, 2020, 7:17am UTC](https://community.postman.com/t/postman-or-to-be-oneof-issue/14617/3 "2020-08-03T07:17:03Z")

</div>

Thanks Allen! Works a charm

---

<div class="post-metadata">

**Author:** ![sergii-rublov](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@sergii-rublov](https://community.postman.com/u/sergii-rublov)\
**Post date:** [February 15, 2022, 11:58am UTC](https://community.postman.com/t/postman-or-to-be-oneof-issue/14617/4 "2022-02-15T11:58:02Z")

</div>

Thanks Allen, it’s working! 👍
