How to use the phantomjs example netsniff.js inside casperjs?

868 views
Skip to first unread message

millisami r

unread,
Apr 24, 2013, 6:11:17 AM4/24/13
to casp...@googlegroups.com
Hi,
This eg from phantomjs at https://github.com/ariya/phantomjs/blob/master/examples/netsniff.js works to get the har file.

But since I'm using casperjs, how can I port or use that script within casperjs ?

millisami r

unread,
Apr 26, 2013, 2:04:46 PM4/26/13
to casp...@googlegroups.com
Any pointers guys!!

Roy Yu

unread,
May 14, 2013, 7:48:41 PM5/14/13
to casp...@googlegroups.com
I actually has the same question as well.

Let's say you write bunch of test case in casper, go to several links in the site, and I also want to take the performance metric for those pages I visit.  

Obviously the netsniff in phantomjs also has that, but how can I intergration or port it?

Thanks

Roy Yu

unread,
May 14, 2013, 9:17:40 PM5/14/13
to casp...@googlegroups.com
Ok, I have the same question earlier today, and sounds like not many answers for that even I google it. And I end up look into the netsniff code and rip out the createHAR method, and repackage it so that the casper can use.

I will post to my github later this week after some more testing. 

Roy Yu

unread,
May 14, 2013, 11:47:00 PM5/14/13
to casp...@googlegroups.com
Here is the netsniff.js for CasperJS


Hope it helps people who have the same issue. 
Reply all
Reply to author
Forward
0 new messages