Nov
10
Posted on 10-11-2012
Filed Under (Perl & Python) by Arun Bagul

Introduction-

Showslow is web based interface to collect yslow data. We can use yslow+showslow to get website loadtime and various other details provided by yslow.

This howto explains how to automate website loadtime/yslow testing using Firefox and Perl (Mechanize::Firefox, Firefox::Application module)

* Please download perl scripts and Strawberry perl for Windows-

URL-

http://www.indiangnu.org/wp-content/uploads/2012/firefox-cli-for-yslow-url-pl.txt

http://www.indiangnu.org/wp-content/uploads/2012/firefox-cli-for-yslow-url-from-csv-pl.txt

http://www.indiangnu.org/wp-content/uploads/2012/yslow-firefox-sh.txt

* Reguirement-

1) Firefox -MozRepl extension to connect to firefox using socket -firebug and yslow extension/addon

2) Perl -WWW::Mechanize::Firefox module -Firefox::Application module *

1] How to create Firefox profile-

root@arunb:/home/arunb/firefox-yslow# /var/firefox-4.0.1/firefox/firefox -CreateProfile yslow /home/arunb/firefox-yslow/yslow_firefox_profile Success: created profile ‘yslow’ at ‘/root/.mozilla/firefox/rjel2s26.yslow/prefs.js’ root@arunb:/home/arunb/firefox-yslow#

NOTE- On Window create profile with ‘firefox -p’ command

* 2] Showslow Setup-

Download showslow and put in Documentroot directory of apache/web server. Then Create DB,Add DB details in config file and type ‘make’ in source directory mysql> create database showslow; mysql> grant all privileges on showslow.* to ‘showslow’@localhost identified by ‘mypass’;

* 3] Now Configure Firefox to submit "yslow" results to "showslow"

Yslow 2.x extensions.yslow.beaconUrl = http://mywebserver/showslow/beacon/yslow/ extensions.yslow.beaconInfo = grade extensions.yslow.optinBeacon = true extensions.yslow.autorun = true

IMP- Please enable following setting in firefox. extensions.firebug.allPagesActivation", "on"

* 4] Perl and Firefox/Mechanize Module -

root@arunb:/home/arunb/firefox-yslow# ./firefox-cli-for-yslow-url.pl http://www.glam.com

For more info – http://www.showslow.org/Tools_configuration#ShowSlow_Installation_and_configuration http://getfirebug.com/wiki/index.php/Firebug_Preferences

Thank You,
Arun Bagul

Similar Posts:

Be Sociable, Share!
(2) Comments    Read More   

Comments

Ravi on 3 January, 2013 at 12:13 pm #

good post Arun


Arun Bagul on 24 January, 2013 at 11:49 am #

If you want to change Ipaddr/port..
then Add following line in perl script

$ENV{MOZREPL} = ‘localhost:4545′;


Post a Comment
Name:
Email:
Website:
Comments:

Get Adobe Flash player

www.flickr.com
arunbagul's photos More of arunbagul's photos