browser testing: All major browsers on ONE machine
Aim of this guide:
Safari, Opera, Chrome and Firefox on a single machine, side-by-side .
Covered in part 1:
Also covered in part 2:
Many sections are independent. Eg, instructions on running multiple versions of a browser are generally applicable.
Contents
Part 2: Installation and configuration
http://10.0.2.2:8888/
1. Which browsers have to be tested?
Statistics are quickly outdated. For this reason, I refer to Usage share of web browsers on Wikipedia, and the following sites for the latest browser version information. Each site is suffixed by a brief usage guide.
January 2012
(Choose the last month). screenshot. Rules of thumb: Which browsers should be included?
Since Opera 15, Opera uses the same engine as Chrome. Quite a lot of users are still using Opera 12 though (when Opera 15 was released, the UX significantly changed).
Unfortunately, Apple dropped support for Windows, so you need to get a Mac or run OS X in a VM to test pages in Safari.
This actually depends on your clients. This guide teaches how to get IE6 and 7 as well, but these browsers are already dead, or close to dead. IE8 is the last supported version of Internet Explorer on Windows XP, which is still used a lot.
Remark
These days, most web browsers use some form of rapid releases with automated updates. When this guide was written, the releases were not as frequent, and thus it was useful to set up a set of browsers without having to look back.
Unless you intentionally want to test applications in old browsers, just get the latest version of the browser and let the auto-updater take care of managing the version.
If you don't need too much flexibility, and quickly want to test a page, I recommend to take a look at BrowserStack.com. After signing up, you can get a 30-minute free trial that grants you access to a lot of desktop and mobile browsers, directly within your browser.
2. Preparation
Before setting up the machine, download all necessary files (see "Download summary" at the end of this section). All files are going to be shared with the virtual machine through a shared folderWhat? How?.
.ova
file inside and run it to import it into VirtualBox. (Images are also available for other virtualization products such as VMware, Parallels, Virtual PC and Hyper-V) net use x: vboxsvrWinShared
(assuming that the shared folder is called WinShared
. This will bind the network directory to the x:
drive). Start > Run >
services.msc
Order the rows by column
Startup Type
, and switch all "Automatic" services to "manual", according to the image. Whenever you want to install a MSI package, run net start msiServer
("Windows Installer"): Desktop > Properties > Desktop > Customize Desktop > Disable "Desktop Cleanup wizard every 60 days"
(Only Internet Explorer requires Internet during installation)
These images are time-bombed, they expire 30 days after first use. When the images are expired, they shut down after an hour of use. If you do not wish to re-create the images every time, change the hardware clock of your VM before activating the image.
In VirtualBox, for example, you can use
VBoxManage modifyvm NAME_OF_VM --biossystemtimeoffset +3600000000
to set the time to 1000 hours in the future (use minus if you want to set it to some point in the past). Download summary
For convenience, it's wise to have all installation files in the shared folder. Here's a brief (complete) list of all necessary files (ordered per step):
IE7 XP and IE8 XP installers can be downloaded here: IE7, IE8
3. Sandboxie
Sandboxie is a lightweight tool which runs applications in a sandbox. It can also be used to install multiple versions of IE/Safari on a single Windows machine.
Running multiple IE/Safari versions simultaneously requires the extended version. If you don't mind testing one IE/Safari version at a time, the standard version is sufficient.
Post-install:
For each new IE/Safari version, you have to follow the following steps:
Select the desired installer, and press OK.
All sandboxed file/registry changes are saved in C:Sandbox
. Applications in this directory start in a sandbox by default. Other programs can easily be started in a sandbox via the contextmenu: "Run Sandboxed" or "Send To > Sandboxie > IE8".
Cleaning up using CCleaner : Run CCleaner in the main environment, then in the individual sandboxes.
Navigate to: Part 2
Contents of part 2 (navigate to: part 1)
4. Internet Explorer
5. Firefox
6. Opera
7. Chrome
8. Safari
9. Developer tools (and shortcuts)
10. Measured set-up time and disk space
• Time needed per browser (install & config)
11. Optimal usage
• Homepage at http://10.0.2.2:8888/
Installation & configuration
Browser configuration tips:
4. Internet Explorer
Windows 7 does not allow running older instances of IE but see note below. That is why a Win XP VM is needed.
IE cannot be downgraded, so start with the lowest version, then upgrade IE in a separate Sandboxie . Set the preferences in the lowest browser version before upgrading, so that you only have to set the main preferences once.
These images expire 30 days after first use. When the images are expired, they shut down after an hour of use. If you do not wish to re-create the images every time, change the hardware clock of your VM before activating the image.
Eg If you use VirtualBox, launch the terminal and issue the following command (replace the capitalized names with something sensible):
VBoxManage modifyvm NAME_OF_VM --biossystemtimeoffset <OFFSET IN MS, prefixed by plus or minus>
Fully offline installers for IE6 (and even IE5.5) are available at this site.
For IE6 and IE7, the Internet Explorer Developer Toolbar should be installed. IE8+ has built-in F12 Developer tools.
Configuration
It is actually possible to run IE6 - 8 in Windows 7 through application virtualization. VMWare ThinApp works great, but it takes considerably more time to set up, because you need to capture the installation of Internet Explorer. Also, the software package is very expensive (keygens are freely available, but unethical).
5. Firefox
Option 1 (lazy) :
Utilu Mozilla Firefox Collection. This tool contains installers for all Firefox versions (200+ MB). Firebug, the Web Developer toolbar and Flash are also included.
Option 2 :
Multiple Firefox versions can easily be installed and executed at the same time.
Tools > Options
(Windows), Edit > Preferences
(Linux) (Do not forget to view the Warning message settings, via the button at the bottom).
Copy
option. Firefox 3.6
) and a destination. Firefox version
option to select the default Firefox version for the profile. Start new instance [-no-remote]
box, to allow multiple simultaneous Firefox versions running at a time. Start Firefox
button to start an instance of Firefox. 6. Opera
Opera : A list of all installers is available on Opera.com. Multiple versions can be installed side-by-side without any problems. During the installation, choose "Custom", and a different directory.
On installation, also choose to use the same profile for all users.
Important preference: Settings > Preferences > Advanced > Security > Do not check for updates.
Note: Opera 15+ uses the same rendering and JavaScript engine as Chrome.
7. Chrome
Chrome : Stand-alone installers can be downloaded from File Hippo.
It is also possible to run multiple Chrome versions side-by-side.
Although Sandboxie can be used, it's recommended to use the next native method in order to run multiple versions side-by-side.
C:Chrome
. After extracting, a
chrome.7z
archive is created. Also extract this file, and descend the created Chrome-bin
directory. Now, you see
chrome.exe
and a dir like 18.0.1025.45
. Move
chrome.exe
to 18.0.1025.45
, then move this directory to C:Chrome
. The remaining files in Chrome-bin
can safely be deleted. Create a shortcut for each version :
"C:Chrome18.0.1024.45chrome.exe" --user-data-dir="..User Data18" --chrome-version=18.0.1025.45
Explanation of this shortcut:
"C:Chrome18.0.1024.45chrome.exe"
• This is the launcher --user-data-dir="..User Data18"
• User profile, relative to the location of chrome.exe
. You could also have used --user-data-dir="C:ChromeUser Data18"
for the same effect. Set your preferences for the lowest Chrome version, and duplicate the User profile for each Chrome version. Older Chrome versions refuse to use User profiles from new versions. --chrome-version=18.0.1025.45
• Location of binaries: 18.0.1025.45
) must be the name of the directory: Regarding configuration: All preferences can be set at chrome://settings/
. I usually change the home page and "Under the hood" settings.
With the lot of Chrome releases, it is not practical to have all versions installed. I have created a VB script that automates these steps, so I can just store the installers, then run the script whenever I need to test an old version of Chrome: https://gist.github.com/Rob--W/2882558
8. Safari
Note: Safari support on Windows has been discontinued. The last supported Safari version on Windows is 5.1.7; you need a Mac or an OS X VM to test your sites in newer Safari versions.
Safari does not natively support multiple versions or user profiles side-by-side. Safari 4 is close to death, so you only have to test 5.*. All Safari versions can be downloaded from Old Apps.
It's important to initially install the oldest version, so that the user profile can be adapted by newer versions.
The Developer tools have to be enabled via Preferences > Advanced > Show Developer menu in menu bar
. After installing Safari, uninstall Apple software Updater, via Control panel > Add/Remove software
.
9. Developer tools (and shortcuts)
Preferences > Advanced > Show Developer menu in menu bar
. 10. Measured set-up time and disk space
Time needed per browser (install & config)
* excludes time to set up a Sandboxie Sandbox ( < 1 minute).
11. Optimal usage
When you've finished installing, use CCleaner to clean junk, then:
From now on, when you've finished testing web pages, turn off the VM, and choose "Restore snapshot". This will keep your VM tidy and fast.
Homepage at http://10.0.2.2:8888/
The guest OS can access the host OS by IP address 10.0.2.2
. A server running on port 8888
can be accessed at the guest through http://10.0.2.2:8888/
, even when the host does not have an internet connection.
For this reason, setting http://10.0.2.2:8888/
as the home page is recommended.
Possible use cases:
All of the previous can easily be implemented on a simple server (I've used Node.js, for example).
Just to pitch in, Microsoft recently started providing a free service called modern.IE.
modern.IE is an undertaking my Microsoft to make cross-browser testing for the Internet Explorer browsers easier. Microsoft has created modern.IE to provide developers and designers with a suite of tools to facilitate IE browser testing.
With modern.IE you have two methods of testing your website in IE. First, modern.IE offers you three months free usage of the web-based browser testing service BrowserStack. You just need a Facebook account to login and start testing.
The second method modern.IE offers is a virtualization image of each browser from IE 6 to IE 10, which can be run on virtualization software like VirtualBox, Virtual PC, Hyper-V or VMWare Player on Windows, Mac or Linux.
Additionally, modern.IE also provides a tool which scans your web page for common coding problems and lists them out for you to correct so that they display correctly in all IE versions.
modern.IE - Cross-Browser IE Testing Tools Suite
链接地址: http://www.djcxy.com/p/41978.html上一篇: 在同一台机器上运行Internet Explorer 6,Internet Explorer 7和Internet Explorer 8
下一篇: 浏览器测试:一台机器上的所有主流浏览器