7
votes

Is there any way to get the page size (in bytes) from the browser with Watir Webdriver? I need to record it for every page (I'm interested into the overall sum, not into detail of each object), so saving to a file and get the file size is not a suitable way.

I can use different browsers, but prefer Firefox,

1
+1 very good question. I am waiting for the answer to come. :) - Arup Rakshit
One way of doing would be getting the source of the page like: src = b.html and then src.bytesize, but it's not the actual size though, it's just the string length. Couldn't have accomplish .. Waiting for guru's answers :) - Sveatoslav
Upvote. Just the byte size of the HTML? Including image sizes too? - orde
My need is about getting all the data moved by that page, but, you know, a partial solution is better than no solution at all... Honestly, I expected a simple and direct call/property, as these infos are already available at browser level (see Tools -> Page information on Firefox). - sbos61

1 Answers

0
votes

This "http://watirwebdriver.com/page-performance/" works only in chrome, but the grouping memory seems to have what you want,

Install and require 'watir-webdriver-performance'