Testing with IE6, IE7 and IE8 on VirtualBox


Microsoft’s Virtual Hard Drives

Microsoft make a series of downloads available for web developers to ensure browser compatibility. Currently you can download IE6-8 on XP and IE7 on Vista. The good news is that they are also free so there is no need to buy a Windows license if all you want to do is browser test. The images generally expire at the end of each quarter but it is fairly trivial to download a new version.
Extracting the .exe

The downloads are available as .exe files so you will need to extract them first. On OSX I use Stuffit which extracts .exe files on the free version. Andrew Odri also has a write up on this and he recommends using The Unarchiver although this didn’t work for me.

On Ubuntu you can use Wine:
sudo apt-get install wine

Once installed you can use Wine to extract the exe:
wine /path/to/yourexe.exe
Get VirtualBox

Next download and install VirtualBox. On OSX you can download a .dmg file. On Ubuntu the following will install it for you:
sudo apt-get install virtualbox
Fixing Microsoft’s duplicate identifiers

The Microsoft images all share the same Hard Disk Identifier which means that VirtualBox will only let you add one of the hard drives to the Media Manager. So we need to fix that. Hat tip to Andrew Odri for documenting this.

For OSX Download Q and then for each vhds we need to convert it to a vdi. This will allow us to test in parallel. On OSX run:
/Applications/Q.app/Contents/MacOS/qemu-img convert -O raw -f vpc yourVHD.vhd RAWimage.raw
VBoxManage convertdd RAWImage.raw NewVDIImage.vdi

For Ubuntu get QEMU:
sudo apt-get install qemu

Once installed on Ubuntu you can then convert the .vhd to a .vdi
qemu-img convert -O raw -f vpc yourVHD.vhd RAWimage.raw
VBoxManage convertdd RAWImage.raw NewVDIImage.vdi
Fixing drivers

Once you have set up your Virtual Machine and booted you will see a blue screen of death. This is because we still need to install some drivers. When booting hold down F8 and boot into Safe Mode with Command Prompt. Cancel any prompts that come up and at the DOS prompt enter
cd \WINDOWS\system32\drivers
ren processr.sys processr.old

Restart the machine and then in the VirtualBox menu go to Devices > Install Guest Additions. Follow the prompts and install the additions. On Ubuntu I found I had to manually download the iso from the link supplied, then mount it in the machine settings before booting. Reboot when you are done.

Once rebooted at the DOS prompt type
D:\VBoxWindowsAdditions-x86.exe /extract /D=C:\Drivers

This will extract the VirtualBox drivers

Then within Windows do

* Start > Administrative Tools > Computer Management
* Select Device Manager.
* Select Batteries, Unknown Device -> Disable
* Select Network Adapters, Ethernet Controller -> Update Driver
* Select Yes, now and every time, click Next
* Select Install from a list or specific location, click Next
* Enter location “C:\Drivers\x86\Network\AMD”
* Click Finish

All done – repeat this method on the other vhds and you will then have a full IE6-8 testing suite that you can run side-by-side if you wish.

This article draws on knowledge gained from the following posts and I’m very grateful to the authors

PHP based Test Driven Development

Agile Dox

PHPUnit’s TestDox functionality looks at a test class and all the test method names and converts them from camel case PHP names to sentences: testBalanceIsInitiallyZero() becomes “Balance is initially zero”. If there are several test methods whose names only differ in a suffix of one or more digits, such as testBalanceCannotBecomeNegative() and testBalanceCannotBecomeNegative2(), the sentence “Balance cannot become negative” will appear only once, assuming that all of these tests succeed.

Cruise Control for PHP

For a continuous build process, we have a framework named PHPUnderCotnrol.
Its basically the same idea as we have in other CruiseControl Systems