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-
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
Software testing is the process of testing software product’s quality, risk and operability. Testing also helps to find bugs and fix them during product development.
1) Selenium (http://seleniumhq.org) –
Selenium is a portable software testing framework for web applications. It supports number of popular programming languages, including C#, Java, Groovy, Perl, PHP, Python and Ruby for writing test cases. The tests can then be run against most modern web browsers. Selenium deploys on Windows, Linux, and Macintosh platforms.
2) Sikuli (http://sikuli.org) –
Sikuli is a visual technology to automate and test graphical user interfaces (GUI) using images (screenshots). Sikuli includes Sikuli Script, a visual scripting API for Jython, and Sikuli IDE, an integrated development environment for writing visual scripts with screenshots easily. Sikuli Script automates anything you see on the screen without internal API’s support. You can programmatically control a web page, a Windows/Linux/Mac OS X desktop application, or even an iphone or android application running in a simulator or via VNC.
3) Watir (http://watir.com) –
Watir is an open-source (BSD) family of Ruby libraries for automating web browsers. It supports your app no matter what technology it is developed in. Watir drives browsers the same way people do. It clicks links, fills in forms, presses buttons. Watir also checks results, such as whether expected text appears on the page. It allows you to write simple and flexible tests that are easy to read and maintain.
4) Unit Testing Tools –
Unit testing is a method by which individual units of source code are tested to determine if they are fit for use. A unit is the smallest testable
part of an application. In procedural programming a unit may be an individual function or procedure. In object-oriented programming a unit is usually an interface, such as a class.
– PHPUnit (http://phpunit.sourceforge.net/) ~ PHPUnit comes as PEAR package. It is Unit testing framework for PHP based on the “JUnit” framework for Java.
– Amock (http://www.amock.org/) ~ Amock is a mock object library written in PHP 5, inspired by EasyMock.
– HTTP::Recorder ~ is Browser-independent recorder that records interactions with web sites and produces scripts for automated playback. Recorder produces WWW::Mechanize scripts by default, but provides functionality to use your own custom logger. We have used ‘WWW::Mechanize’ to automate website load time testing using showslow (http://www.showslow.com/) and yslow firefox extension.
– PyUnit ( http://pyunit.sourceforge.net/ ) ~ A unit testing framework for Python based on JUnit and XUnit, the de-facto standard frameworks for Java and SmallTalk respectively.
– Achoo (http://web.quuxo.com/products/achoo/) ~ Achoo is a fluent interface for unit testing Python objects. Achoo makes it easy to make assertions about the properties and behaviours of Python objects.
– SQLUnit (http://sqlunit.sourceforge.net/) ~ SQLUnit is a regression and unit testing harness for testing database stored procedures.
An SQLUnit test suite would be written as an XML file. The SQLUnit harness, which is written in Java, uses the JUnit unit testing framework to
convert the XML test specifications to JDBC calls and compare the results generated from the calls with the specified results.
5) iMacros (http://www.iopus.com/iMacros) –
iMacros is an extension for the Mozilla Firefox, Google Chrome, and Internet Explorer web browsers which adds record and replay functionality similar to that found in web testing and form filler software.