# Could not get any response - test

**URL:** <https://community.postman.com/t/could-not-get-any-response-test/7052>\
**Category:** Help Hub\
**Tags:** response\
**Created:** [August 8, 2019, 11:48am UTC](https://community.postman.com/t/could-not-get-any-response-test/7052 "2019-08-08T11:48:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![giuseppe.lacagnina](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/giuseppe.lacagnina/32/1689_2.png) [@giuseppe.lacagnina](https://community.postman.com/u/giuseppe.lacagnina)\
**Post date:** [August 8, 2019, 11:48am UTC](https://community.postman.com/t/could-not-get-any-response-test/7052/1 "2019-08-08T11:48:03Z")

</div>

Hi.

I would like to define a test that simply fails whenever a call returns the error “could not get any response”. Is that possible?

I simply need to detect whenever a service is not responding and fail a test.

Thanks!

---

<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:** [August 8, 2019, 1:01pm UTC](https://community.postman.com/t/could-not-get-any-response-test/7052/2 "2019-08-08T13:01:28Z")

</div>

Tests don’t run unless a response comes back.

Is there a specific request that might be down? You might be able to do something like this:

```javascript
pm.sendRequest('https://invalidurl', function(err, res){
    if(err){
        pm.test('invalidurl is down', function() { pm.expect(false).to.be.true; });
    } else {
        pm.setNextRequest('invalidurl Request');
    }
});

```

The only problem with this code is that it’s running async and your collection would continue to run. I’m not a node JS expert, so maybe there is a way to await it.

---

<div class="post-metadata">

**Author:** ![giuseppe.lacagnina](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/giuseppe.lacagnina/32/1689_2.png) [@giuseppe.lacagnina](https://community.postman.com/u/giuseppe.lacagnina)\
**Post date:** [August 8, 2019, 1:16pm UTC](https://community.postman.com/t/could-not-get-any-response-test/7052/3 "2019-08-08T13:16:38Z")

</div>

Makes sense, thanks! Some limitations of Postman seem quite annoying to me ☹

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 8, 2019, 5:25pm UTC](https://community.postman.com/t/could-not-get-any-response-test/7052/4 "2019-08-08T17:25:21Z")

</div>

I wanted to point out that there is a difference between the Postman App and Newman.

In Newman, even if there is no response, the tests will be executed and the collection run will fail.

Considering that I can manually observe in Postman that something went wrong, I won’t write additional code to handle this case.

 ![58](https://us1.discourse-cdn.com/getpostman/original/3X/7/7/777063bbcf88d922f98371b29a0b839856674eea.jpeg)

---

<div class="post-metadata">

**Author:** ![giuseppe.lacagnina](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/giuseppe.lacagnina/32/1689_2.png) [@giuseppe.lacagnina](https://community.postman.com/u/giuseppe.lacagnina)\
**Post date:** [August 9, 2019, 11:39am UTC](https://community.postman.com/t/could-not-get-any-response-test/7052/5 "2019-08-09T11:39:50Z")

</div>

Thanks!!! This is very, very good news for me.
