WPTAPI giving error in private instance


I have a private instance setup and have valid API key. when i try in browser it is working well. but when i try as module i am getting name: ‘WPTAPIError’, code: 302, message: ‘Found’

Browser URL - Working : Getting Valid 200 response

Module code not working : ‘WPTAPIError’, code: 302, message: ‘Found’

var WebPageTest = require(‘WebPageTest’);
var wpt = new WebPageTest(‘https://demoprivateinstance.com/’, ‘sampleAPIKEY’);
wpt.runTest(‘https://www.demoURL.com/’, {
connectivity: ‘Cable’,
location: ‘demoLocation’,
firstViewOnly: true,
runs: 1,
video: true
}, function processTestRequest(err, result) {
console.log(err || result)

Please advise