Browser Testing Internet Explorer with VMWare Fusion and Snapshots
Browser testing IE (Internet Explorer) has for a long time, been a pain. Not mentioning the lack of standards compliance in older versions that are still in use today, only one version of IE can be installed on an opertating system at a time. There are multiple ways around this, each with their own pros and cons. My prefered choice is to use virtual machines via VMWare Fusion for Mac. The only downside to this solution for me is the amount of space required for each virtual machine and their maintenance.
In this article, I'll describe how you can efficiently test versions 7 - 11 of Internet Explorer, without gobbling up precious drive space. If you're not using VMWare Fusion for Mac, keep reading as the methodology applies to other similar software too, such as VMWare WorkStation and Parallels.
Sourcing Virtual Machines
A virtual machine is a software emulation of a computer. It allows you to run an operating system on another operating system -- Windows on a Mac for example.
Kindly, Microsoft have made virtual machines of their operating systems and browsers available for free on modern.IE. Aside from hosting virtual machines, there are many more useful tools and tips for working with Internet Explorer so consider having a look around the site.
modern.IE hosts Windows XP virtual machines, right through to the latest Windows 8.1 and browser versions are made available on mutiple operating systems where applicable - IE10 on Windows 7 and 8 for example.
Installing a virtual machine doesn't come cheap though -- when installed, they weigh in at around 10 - 20GB, so if like me you only have a small drive, you don't have the freedom to download them all.
In my freelance work, I test Internet Explorer versions 7 - 11. So, do I download 5 virtual machines? No. On top of the space taken up by my own operating system, that probably wouldn't leave any room to work. There's a much more efficient way to proceed.
Firstly, Internet Explorer 7 is only made available on Vista, so I have no choice but to download the IE7 - Vista virtual machine.
Internet Explorer Versions 8 - 11 however, can all be run on Windows 7. Rather than download 4 hefty virtual machines just for each browser version, we can instead download one then make use of VMWare Fusion's Snapshots feature.
Setting up Virtual Machines
To set up a virtual machine, follow these steps:
- Once you've downloaded the virtual machine you'd like to install, follow the instructions at the bottom of the page you got them from to turn the files into virtual machines.
- Open VMWare Fusion and you'll be greeted with the Virtual Machine Library. Click the Add button, followed by "New...".
- As our virtual machines are file based, we don't have a disc, so click "Continue without disc". Then click "Use an existing virtual disk".
- In the file dialog that appears, find the virtual machine you'd like to install and within it click the
.vmdkfile. As the aim is to use as little space as possible and the virtual disk is one we just created, I'd recommend choosing the "Take this disk away from the virtual machine currently using it" option.
- With "Take this virtual disk..." selected, click "Choose", then "Continue".
- On the next page, choose the Operating System and Version you are installing, then "Continue".
- Click "Finish".
When the virtual machine has been installed, you'll see it appear in the VIRTUAL MACHINES list. Double click the virtual machine to have it run.
When the operating system starts, VMWare Fusion will install some drivers to extend its functionality on the operating system. Wait for it to complete and you'll be prompted to restart. Do so and once the operating system has booted again, shut it down.
Setting Up Snapshots
Whilst you were waiting for the drivers to install you may have noticed the desktop background had some information about the virtual machine (if you downloaded the modern.IE virtual machine's, that is).
Most importantly, the information stated that the operating system only has a 30-day trial license. To work around this, we need to create a snapshot. A snapshot will save the state of a virtual machine. As we've only just set up the operating system, if we create the snapshot now then restore it at a later date, the 30 day trial will start from scratch again -- allowing us to work around the 30-day trial limitation forever.
- With the virtual machine shut down in the Virtual Machine Library click "Snapshots"
- Click the "Current State" to highlight it
- Click "Take" to take a snapshot
With the snapshot set up, whenever you want to start from that point in time again, click the "Snapshots" button in the Virtual Machine Library and double click the snapshot. You'll be asked if you want to save changes to the "Current State" -- essentially, creating another snapshot. As we've got the operating system ready for testing though, we don't need another snapshot, so click "Don't Save".
Multiple Browsers on the Same Virtual Machine via Snapshots
I mentioned earlier that I use snapshots to run Internet Explorer versions 8 - 11 on one Windows 7 virtual machine. A snapshot takes up much less space than an entire virtual machine -- saving lots of disk space.
- With the Windows 7 virtual machine installed click it once in the VIRTUAL MACHINES list, then click "Snapshots".
- If you followed both the Setting Up Virtual Machines and Setting Up Snapshots instructions above for the IE8 - Win7 virtual machine, then you should have a "Current State" listed and a snapshot. Name the snapshot IE8.
- Double click this snapshot, followed by "Don't Save" to make it the current state.
- Go back to the Virtual Machine Library and click "Start Up".
- With Windows 7 booted, open IE8, go to your prefed search engine and search for "download IE9".
- Download and install IE9. We now have an IE8 snapshot, and IE9 installed in our "Current State".
- Shut down the virtual machine, click "Snapshots" and with the "Current State" highlighted, click "Take" again. Save this snapshot as IE9.
- Repeat steps 3 - 7, to install IE10 and IE11 into their own snapshots.
Once complete, you'll have two virtual machines listed, one Vista with a snapshot for IE7, the other Windows 7 with 4 snapshots for IE8 - IE11.
Maintaining Virtual Machines
If maintaining space is really essential, every so often you should shut down your virtual machines and use VMWare Fusion's "Clean Up Virtual Machine" option. You can get to this by right clicking a virtual machine in the list, then choose "Get Info...".
By utilizing VMWare Fusion's Snapshots feature, we're able to test all versions of Internet Explorer that are still deemed to be in use today without taking up huge portions of a drive's space.
Ian Lunn is a Web Designer & Front-end Developer with 12 years commercial experience, author of CSS3 Foundations, and graduate of Internet Technology. He creates successful websites that are thoughtfully designed and built with performance and best practices in mind.