summaryrefslogtreecommitdiff
path: root/bin/loadTesting/loader.js
blob: ddcd0572ddab931877ffc552f569cd2990700fdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var page = new WebPage(),
    t, address;

if (phantom.args.length === 0) {
    console.log('Usage: loader.js <some URL>');
    phantom.exit();
} else {
    t = Date.now();
    address = phantom.args[0];

    var page = new WebPage();
    page.onResourceRequested = function (request) {
        console.log('Request ' + JSON.stringify(request, undefined, 4));
    };
    page.onResourceReceived = function (response) {
        console.log('Receive ' + JSON.stringify(response, undefined, 4));
    };
    page.open(address);

}