WebPagetest Forums
getRequestData returning undefined in response - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: getRequestData returning undefined in response (/showthread.php?tid=15254)



getRequestData returning undefined in response - anilpothala - 02-27-2018 05:48 AM

Hello,

When i trying to use method getRequestData, it is returning undefined when i print the log in console for a successful test run.

======>2=====undefined

can some one help me out.

var config = require('./Config.json');
var assert = require('assert'),
path = require('path'),
WebPageTest = require('webpagetest/lib/webpagetest');
var AnalyticsData = require('./AnalyticsData.json');

var wpt = new WebPageTest('www.webpagetest.org', 'A.f58cfe49433108889518a1511c235064');
describe('Search Test Suite', function() {
it('Searching for ipods', function(done) {
var script = wpt.scriptToString([
{navigate: config.searchipods},
'waitForComplete'
]);
wpt.runTest(script, {
pollResults: 5,
firstViewOnly : true,
connectivity: "3GFast",
label: 'Search - ipods',
video:true,
location:"SanFrancisco"

},

function(err, res) {

console.log(res.data.id)

wpt.getRequestData(res.data.id,function(err, res){

console.log("======>"+AnalyticsData.FACETCLICK.length+"====="+res)


if (err) return done(err);
done();

})


});

this.timeout(300000);

});


});