3

I'm using Newman in order to execute a POSTMAN collection but I always have the error "connect ETIMEDOUT". Using just POSTMAN it works fine, but not with NEWMAN. The testing is quite simple, create a content on the server https://jsonblob.com/api

I'm following the tutorial http://blog.getpostman.com/2014/04/17/how-to-write-automated-tests-for-apis-with-postman-part-2/

Thanks you very much in advance. I put below the collection and the enviroment file.

This is the collection: { "id": "a6a6b2fe-db11-4c57-9144-6b3324174f18", "name": "Newman", "values": [ { "key": "url", "value": "https://jsonblob.com", "enabled": true, "type": "text" }, { "key": "deviceMapping", "value": "{\n \"content\": \"My first blog post :)\"\n}", "enabled": true, "type": "text" }, { "key": "blogLink", "value": "https://jsonblob.com/api/jsonBlob/b7f2ce87-4c8e-11e8-917b-9137e61d314b", "enabled": true, "type": "text" } ], "_postman_variable_scope": "environment", "_postman_exported_at": "2018-04-30T16:13:07.630Z", "_postman_exported_using": "Postman/6.0.10" }

This is the enviroment file: { "id": "a6a6b2fe-db11-4c57-9144-6b3324174f18", "name": "Newman", "values": [ { "key": "url", "value": "https://jsonblob.com", "enabled": true, "type": "text" }, { "key": "deviceMapping", "value": "{\n \"content\": \"My first blog post :)\"\n}", "enabled": true, "type": "text" }, { "key": "blogLink", "value": "https://jsonblob.com/api/jsonBlob/b7f2ce87-4c8e-11e8-917b-9137e61d314b", "enabled": true, "type": "text" } ], "_postman_variable_scope": "environment", "_postman_exported_at": "2018-04-30T16:13:07.630Z", "_postman_exported_using": "Postman/6.0.10" }

Paco
  • 41
  • 1
  • 1
  • 5
  • 1
    What have you tried so far? What requests do you have in your collection? How are you running Newman? etc You're going to need to update the question with a lot more information. I would also recommend reading this and change your tests as that blog is quite old now - http://blog.getpostman.com/2017/10/25/writing-tests-in-postman/ – Danny Dainton Apr 30 '18 at 13:44
  • Hello. Thanks you for your answer. Well, I'm sending a request of the type POST to the IP https://jsonblob.com/api that would create a new content in that service. I'm runing NEWMAN with the console CMD, going to the folder where the collection is stored and using the command: "newman run Testing.json" but I have used as well "newman run --delay-request[300000] Testing.json" but I have the same problem. I will see the link that you have put. Thanks you very much again. – Paco Apr 30 '18 at 14:31
  • Is there a reason why you have a 5min delay between the requests? How many requests do you have? – Danny Dainton Apr 30 '18 at 14:56
  • I have two request, a POST to create the content and a GET to get this one. There is not a reaso because I put this time out in particular. Thanks you again and best regards. – Paco Apr 30 '18 at 15:15
  • Are you saving the 'location' to an environment file like in the tutorial? You haven't added this to your Newman CLI arg if you are. Also `newman run --delay-request[300000] Testing.json` this shouldn't really work either as the first argument should be the 'collection' file and not a arg flag. – Danny Dainton Apr 30 '18 at 15:28
  • Hello. I'm storing the 'location' in a variable called 'blogLink'. How could I add this to the Newman CLI? Please. Thanks you again. – Paco Apr 30 '18 at 15:59
  • It should be saving that 'location' value to the environment file, as per the tutorial that you're following - This file fills in the `{{...}}` placeholders like the request URL base path etc. In the UI, you would select the file from the dropdown list but for `newman` you to need to supply the path to it. So you CLI arg would be something like: `newman run -e ` – Danny Dainton Apr 30 '18 at 16:06
  • I have had the same connect ETIMEOUT error with that CLI. I have added the collection and the enviroment file to the question, I hope it can helps. Thanks a lot. – Paco Apr 30 '18 at 16:23
  • What version of newman and node do you have - It doesn't look like its a Postman specific issue with the files (might be wrong) but it seems more environmental. As I don't know what your set up is, it's difficult to help further and it shouldn't really be done in the comments section anyway. – Danny Dainton Apr 30 '18 at 16:33
  • Hello, my Newman version is 3.9.3. Sorry if I'm not asking it in the right place, if there is another way much better, I will do. Thanks again for your help. – Paco May 02 '18 at 08:20

3 Answers3

1

Fixed: It was a proxy matter. I wrote these two commands in the cmd console:

set HTTPS_proxy=myuser:mypassword@ipoftheproxy:portoftheproxy
set HTTP_proxy=myuser:mypassword@ipoftheproxy:portoftheproxy
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Paco
  • 41
  • 1
  • 1
  • 5
0

It was a proxy issue for me, I added my organization specific proxy in Postman settings and it worked.

Ramesh Singh
  • 73
  • 1
  • 9
-1

Fixed by change the proxy protocol

For Mac User

  1. Go to Settings -> Network -> Advanced -> Proxies
  2. Tick "Auto Proxy Discovery"
  3. Click "Ok"
  4. Click "Apply"
  5. Restart Postman enter image description here

Another way:

  1. Go to Postman Settings
  2. Set SSL certificate verification to off

Let me know if you found any issue

enter image description here

Muliawan
  • 14
  • 3