# pm.sendRequest synchronous

**URL:** <https://community.postman.com/t/pm-sendrequest-synchronous/10869>\
**Category:** Help Hub\
**Tags:** newman-project, pmsendrequest, reportportal\
**Created:** [February 18, 2020, 5:36pm UTC](https://community.postman.com/t/pm-sendrequest-synchronous/10869 "2020-02-18T17:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![entorres](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@entorres](https://community.postman.com/u/entorres)\
**Post date:** [February 18, 2020, 5:36pm UTC](https://community.postman.com/t/pm-sendrequest-synchronous/10869/1 "2020-02-18T17:36:08Z")

</div>

**Context** :  
I’m trying to use [ReportPortal.io](https://reportportal.io/) and one of its agents ([postman-agent](https://github.com/reportportal/agent-postman)) to run my Postman Collections.

The _postman-agent_ does not currently support asynchronous calls inside the tests (which a really require to have) so I’ve been trying to find a solution to this (or a workaround)

I found some “solutions” and tried [this one here](https://community.postman.com/t/can-i-use-pm-sendrequest-to-send-requests-synchronously/225/11). But got no luck so far.

Is there a native way to make the _pm.sendRequest_ calls inside _Tests_ synchronous. And if not, how would you guys do it? Is this something that will be released later?

I’ll leave here my code and the solution I tried to implement:

```
 function getAPIRequest(api,guid)
    {
        var options = {
            method: 'GET',
            url: pm.environment.get("apibaseurl") + '/' + api + '/' + guid,
            header: {
                'Content-Type': 'application/json',
                "X-CustomCredentials": pm.variables.get("token")
              }, json: true
        };
        return options;
    }

    function sendRequest(api,id,property,column) {
      return new Promise(resolve => {
        pm.sendRequest(getAPIRequest(api,id),
          function(err, res) {
             pm.test("AUTO010 - " + property + " reference guid is correct.", function(){
                    pm.expect(res.code).to.eql(200);
            });
            db_value = db_values[column];
            pm.test("AUTO014 -The property " + property + " id match with " + column + "from the database.", function () {pm.expect(res.json().code).to.be.eql(db_value) });
          }
        );
      });
    }

    async function senReq(api,id,property,colum) {
      return await sendRequest(api,id,property,colum);
    }

```

Thanks in advance 🙂
