# Newman API - Running a collection does not ignore disabled get parameters

**URL:** <https://community.postman.com/t/newman-api-running-a-collection-does-not-ignore-disabled-get-parameters/814>\
**Category:** Help Hub\
**Tags:** newman-project, collection, sdk\
**Created:** [January 30, 2018, 12:17am UTC](https://community.postman.com/t/newman-api-running-a-collection-does-not-ignore-disabled-get-parameters/814 "2018-01-30T00:17:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aksbenz](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@aksbenz](https://community.postman.com/u/aksbenz)\
**Post date:** [January 30, 2018, 12:17am UTC](https://community.postman.com/t/newman-api-running-a-collection-does-not-ignore-disabled-get-parameters/814/1 "2018-01-30T00:17:10Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Using newman api, when we run a collection with option.collection as a collection object, then the disabled parameters in a get request are not ignored and are included in the call, whereas if we run with option.collection as require(filepath), then it works correctly.

I am modifying the Collection using collection sdk before running, hence cannot pass the file path as option to newman.

EXAMPLE:

Using the following collection:

```auto
{
	"info": {
		"name": "Temp",
		"_postman_id": "734b99af-72b1-a510-dc4c-10214c91aeee",
		"description": "",
		"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
	},
	"item": [
		{
			"name": "GET Request",
			"event": [
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							"var responseJSON;",
							"",
							"try { ",
							" responseJSON = JSON.parse(responseBody); ",
							" tests['response is valid JSON'] = true;",
							"}",
							"catch (e) { ",
							" responseJSON = {}; ",
							" tests['response is valid JSON'] = false;",
							"}",
							"",
							"tests['response json contains headers'] = _.has(responseJSON, 'headers');",
							"tests['response json contains args'] = _.has(responseJSON, 'args');",
							"tests['response json contains url'] = _.has(responseJSON, 'url');",
							"",
							"tests['args key contains argument passed as url parameter'] = ('test' in responseJSON.args);",
							"tests['args passed via request url params has value \"123\"'] = (_.get(responseJSON, 'args.test') === \"123\");"
						]
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [],
				"body": {},
				"url": {
					"raw": "https://postman-echo.com/get?test=123&value1=test1",
					"protocol": "https",
					"host": [
						"postman-echo",
						"com"
					],
					"path": [
						"get"
					],
					"query": [
						{
							"key": "test",
							"value": "123",
							"equals": true
						},
						{
							"key": "value1",
							"value": "test1",
							"equals": true
						},
						{
							"key": "value2",
							"value": "test2",
							"equals": true,
							"disabled": true
						},
						{
							"key": "value3",
							"value": "test3",
							"equals": true,
							"disabled": true
						}
					]
				},
				"description": "The HTTP `GET` request method is meant to retrieve data from a server. The data\nis identified by a unique URI (Uniform Resource Identifier). \n\nA `GET` request can pass parameters to the server using \"Query String \nParameters\". For example, in the following request,\n\n> http://example.com/hi/there?hand=wave\n\nThe parameter \"hand\" has the value \"wave\".\n\nThis endpoint echoes the HTTP headers, request parameters and the complete\nURI requested."
			},
			"response": []
		}
	]
}

```

**Running with following command:**

```auto
newman.run({
    collection: new Collection(JSON.parse(fs.readFileSync(filepath).toString())),
    reporters: 'cli'
}, (err, summary) => {
    console.log('DONE');
});

```

Invokes the GET request incorrectly with the disabled parameters:

```auto
GET https://postman-echo.com/get?test=123&value1=test1&value2=test2&value3=test3

```

**Running newman with command:**

```auto
newman.run({
    collection: require(filepath),
    reporters: 'cli'
}, (err, summary) => {
    console.log('DONE');
});

```

Invokes the GET request correctly:

```auto
GET https://postman-echo.com/get?test=123&value1=test1

```

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [January 31, 2018, 7:11am UTC](https://community.postman.com/t/newman-api-running-a-collection-does-not-ignore-disabled-get-parameters/814/2 "2018-01-31T07:11:17Z")

</div>

@aksbenz Which version of Newman and Node are you using? You can find this with `newman -v` and `node -v`.

---

<div class="post-metadata">

**Author:** ![aksbenz](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@aksbenz](https://community.postman.com/u/aksbenz)\
**Post date:** [January 31, 2018, 10:00pm UTC](https://community.postman.com/t/newman-api-running-a-collection-does-not-ignore-disabled-get-parameters/814/3 "2018-01-31T22:00:31Z")

</div>

node v7.0.0  
newman v3.9.3
