mardi 5 janvier 2016

how can casperjs/phantomjs work with websocket?

I have a page using websocket and it works well in Chrome.

Now I am trying to test it with casperjs/phantomjs.

However it seems that websoket won't work at all.

Does casperjs/phantomjs support websoket? I mean the page send data and get data with webscoket, not using casperjs/phantomjs to send/get data.

Is there any way to test that if websoket works?

//can load file but seems not work    
casper.waitForResource("socketConnection.js", function() {
    this.echo('socket has been loaded.');
    this.wait(14000, function() {
        this.echo("I've waited for some seconds.");
        this.capture('socket.png');
    });
});

Aucun commentaire:

Enregistrer un commentaire