1
votes

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" }

2
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 - blog.getpostman.com/2017/10/25/writing-tests-in-postman - Danny Dainton
Hello. Thanks you for your answer. Well, I'm sending a request of the type POST to the IP 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
Is there a reason why you have a 5min delay between the requests? How many requests do you have? - Danny Dainton
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
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

2 Answers

1
votes

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
0
votes

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