Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options.ignoreRedirects is not working for request from pre-request script #3203

Open
vanipatel91 opened this issue Feb 15, 2024 · 1 comment

Comments

@vanipatel91
Copy link

Version and environment information:

  1. I am using Newman Version (6.1.0):
  2. OS details (Windows 10):
  3. Using newman via cli with nodejs and using node options to execute multiple collections with single script.
  4. Encountered this issue while trying to process request from pre-request script of collection using pm.sendRequest to process. I have set ignoreRedirects as true but still it was not working, whereas same is working fine when we process separate request from collection.
    Sample command is as below:
    const options = {
    collection: './Tests.postman_collection.json',
    environment: require(pathEnv),
    ignoreRedirects: true,
    insecure: true,
    reporters: ['cli', 'htmlextra', 'junit'],
    reporter: {
    junit: {
    export: './ReportFile/test_config.xml'
    },
    htmlextra: {
    export: './ReportFile/test_report.html',
    }
    }
    }
    test_collection = newman.run(options, cb);
    var collections = []; // We have multiple collections to add in same array
    collections.push(test_collection);
    async.parallel(collections, async function (err, results) {
    if (err) {
    console.log(err)
    }
    else {
    console.log("Collection Processed Successfully);
    }
@vanipatel91
Copy link
Author

vanipatel91 commented Feb 16, 2024

FYI, ignoreRedirects is working fine when we run from CLI with command
newman run collection_name --ignore-redirects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant