[LRUG] Testing Browser Connections and Timings via Ruby

Jon Leighton j at jonathanleighton.com
Tue Sep 18 09:32:59 PDT 2012


On 18/09/12 16:55, Frederick Cheung wrote:
>> Hi All,
>>
>> I've got an app that I regularly need to test/monitor front end page
>> performance and external (browser side) service connection data, some
>> of which are iframe embeds. Up until this point I've been doing it by
>> hand (Chrome Inspector Network panel + HAR exports) thinking at some
>> point I'd automate. That day has come but I'm having trouble finding
>> an easy way to do it so I thought I'd ask the LRUG omni-mind.
>>
> 
> I think that if you load pages in phantomjs (eg via poltergeist) that
> you can get all the data that goes into the network activity panel

Yes: PhantomJS has an onResourceReceived callback which fires every time
a chunk of a resource on the page is received. It take one argument
which is an object containing, amongst other things a timestamp.

Poltergeist also exposed this data. You can access it by calling
"page.driver.network_traffic".

YMMV etc, but maybe this helps.

Jon

-- 
http://jonathanleighton.com/



More information about the Chat mailing list