Tuesday, January 17, 2012

How do I test my web application against IE6 and IE7 in Windows 7?

How do I test my web application against IE6 and IE7 and IE8 and IE9 in Windows 7?

Problem: Windows 7 comes with IE8 or IE9 or IE10 (and does not have a path back to use IE6 or IE7, (and don't patronize me with browser emulation solutions, they all suck.) Microsoft has sunsetted support for IE6 and IE7 is getting closer to being out of support as well.

Solution:

Go here http://www.microsoft.com/windows/virtual-pc/download.aspx

  1. Download the 500 MB Windows XP Mode VHD installer.
  2. Run the installer.
  3. Download Virtual PC if you lack this.
  4. Test with IE6 bundled in the vhd.
  5. Make a second vhd and upgrade to IE7 within the Virtual PC VM.*
  6. Rinse and repeat for IE8, IE9
  7. If you are doing local web development, install the Microsoft Loopback adapter on your host OS.
  8. You now have the ability to test your site in native IE6 and IE7 and IE8, IE9, and IE10.

Other tools exist to emulate or simulate IE6 and IE7 web rendering, but they will always fall short of the mark and open you to risks if they fail to display your site *exactly* the way it displays in the native browser and I recommend that they should not be used for any project where you can use a VM instead.

*For this step there are some special tricks to it. After making a copy of your IE6 vhd file, you need to change it's hardware signature to avoid conflicts with running it in parallel with your IE6 VM.

Windows 7 comes with a command line utility called diskpart that can let you view and change the disk signature.


Open a command prompt as administrator. To do this in Windows 7, click the Windows start menu (the round Windows icon on the left bottom corner), type "cmd" (without the quotes), right click the "cmd.exe" item that appears at the top of your menu, and click the line "Run as administrator". Do this even if you are already logged in as administrator, since on Windows 7, administrators run with reduced rights by default.


A black command prompt window will open. In Windows 7, the title bar of the window will tell you that you are running it as Administrator. If it does not, it means you did not do what I just said above. Return and follow the first step, or you will not be able to successfully carry out the rest of this tutorial.


Type "diskpart" (without the quotes) into the window. (Note: for this and the other commands described here, you'll have to hit the ENTER key after you finish typing your commands for them to take effect.)


Microsoft DiskPart will start. When it is ready, it will issue a "DISKPART>" prompt, allowing you to enter your commands.


Type "list disk" (without the quotes). This will list all the disks that are currently mounted (connected to the system). The disk will not have the usual names and labels that you're accustomed to from the Windows Explorer interface, so you will have to recognize them by their sizes.


Note that "list disk" actually lists the physical disks, and not the partitions that you may have assigned drive letters. This means that if you have 2 physical disks, with 3 partitions on each, so that you have drives C:, D:, E:, F:, G: and H:, "list disk" will only show "Disk 0" and "Disk 1".


To view the signature of a disk, you must first select it. To select a disk, type "select disk x" (without the quotes) where x is the number of the disk from your "list disk" display. When you type (say) "select disk 1", DiskPart will respond by telling you "Disk 1 is now the selected disk".


Now type "uniqueid disk" (again, without the quotes). DiskPart will respond with the disk's signature, a series of hexadecimal digits (or at least I think it's hexadecimal).


To change the signature to some other number, type "uniqueid disk ID=[NEW SIGNATURE]" (without the quotes) where "[NEW SIGNATURE]" stands for the new identifier you want for the disk (without the square brackets and without the quotes). However, before you do that, you may want to type "help uniqueid disk", which will give you more information on how the command works. You may also want to find out the disk signatures of your other disks on your system before you modify your current one so that you don't cause a new signature collision in trying to solve your current problem. In addition, if you're really not sure how many digits you should give your disk, perhaps try changing only one digit of the current signature (eg, increasing or decreasing it by 1). Remember my disclaimer above: I really don't know what I'm talking about here: do it at your own risk.


To quit DiskPart, type "exit". Incidentally, in case you get lost while running DiskPart, when you are at the "DISKPART>" prompt, you can type "help" to get a list of commands. Typing "help" followed by the command typically gives you more info about that command.


Once you've quit DiskPart, type "exit" again to quit the Administrator Command Prompt


No comments:

About Me

My photo
Lead Java Developer Husband and Father

Tags