
Full interactive iOS Mobile Safari browser testing is possible right on your Mac, no additional services necessary. We'll set up Apple's Simulator and configure it for testing Safari on a wide range of iOS versions and devices.
A version of this post originally appeared on viget.com
This article is part of a series on running cross-browser tests directly on your primary computer. The first in the series is Set Up Simulator and Test iOS Mobile Safari on Mac.
According to one well known source of desktop browser marketshare data, in November 2018 Internet Explorer usage was at 2.8% in the United States and 5.05% worldwide; Edge usage was at 2.15% in the United States and 4.25% worldwide. Not much perhaps compared to the leader Chrome (61.77% in the U.S., 49.13% worldwide) or even the runner up Safari (15.09% in the U.S., 32.38% worldwide). But that means as many as 1 in 20 United States users could be using either IE or Edge, and that means it's well worth considering testing your site in Microsoft browsers. (Each site's audience is different, and the decision to spend time and money to make grumpy IE11 match a comp should be made with that site's traffic in mind.)
Internet Explorer and Edge only run on Microsoft operating systems. For front-end developers and quality assurance testers on Mac or Linux computers, those browsers are often tested when development is nearly finished, using a paid web app such as BrowserStack or CrossBrowserTesting aimed at visual QA more than debugging or high-fidelity UX testing.
A Windows 10 "virtual machine" (VM) —in lay terms, think a full additional computer in an app on your computer— puts full true Microsoft browser testing at your fingertips.
This guide will get you set up with a Windows 10 VM. It takes 30-40 minutes, plus the time to download a 5GB disk image. You will need at least 25GB of disk space, but 50GB is recommended to give Windows 10 space to grow over time. You'll use free software, including a full copy of Windows 10 provided for free by Microsoft.
There are various tools out there for running virtual machines (VMs). We'll use VirtualBox - it's free, it works great, it's being actively developed, and it's available for every operating system.
Installers come on physical media (DVDs or thumb drives) or in disk image files (typically .iso
) You'll use .iso
files for your VirtualBox VMs. Microsoft provides Windows 10 iso
for free! Go to the Download Windows 10 Disc Image (ISO File) page. You'll be asked to make some choices:
Select your edition
As of this writing, the available options were an update a couple months old and an update a couple months older than that. Go with the most recent.
Select your language
For English users, I go with "English" over "English International." The international version uses British spellings in the Windows UI — "colour," for example, as opposed to the American "color." There are some claims out there that the International version is problematically different. I don't know if that's true or not. I do know that "English" (which means American English) can be configured to use non-American keyboard mappings.
Select your processor
Don't know if your computer is 32-bit or 64-bit? It's probably 64-bit. Apple for example hasn't made a 32-bit computer since 2011. If you have a Mac, you can double check by going to the Apple menu and selecting "About This Mac": if the "Processor" is Core Duo it's 32-bit, anything else is 64; if you have a PC, you'll just have to look it up!
Open VirtualBox, and click "New"
Fill out the "Name." Using the OS as the name is a good convention, and will help you keep track of things later on. And if you name the VM after the OS, VirtualBox will automatically select the "Type" and "Version".
On the next screen, bump the "Memory size." The default is 2048MB (2GB). 4096MB (4GB) is a good place to start. If your computer has at least 16GB of RAM, consider giving 8192MB (8GB) to the virtual machine. You can always change this later if you find it makes your actual computer too slow when the virtual is running.
On the next two screens, follow the defaults for:
For "Storage on physical hard disk," choose "Dynamically allocated." With this setting, the amount of space your virtual machine takes up on your real machine depends on exactly what virtual machine needs. With a "fixed size" virtual machine, the virtual machine reserves the amount of storage you specify even if you specify more than it needs. Dynamic allocation has a significant long-term benefit: you'll be able to non-destructively modify the maximum size setting. This is relevant to Windows 10, which in my experience will need more and more storage, even if you don't install anything new. In about a year and a half, I saw one Windows 10 virtual machine's needs increase by about 15GB. Because it was "fixed size," I was not able to change the disk size without losing data.
The "File location and size" gives you an opportunity to change where on your computer you keep the files related to this VM. I do not recommend renaming the virtual hard disk file — historically, depending on the operating system, that could confuse things. But if you want to change the location, click the folder icon and select the location. I keep my VMs in a "VMs" folder in my home folder.
For the "Size," stick with the default 50GB. Remember that thanks to dynamic storage allocation your virtual machine should end up taking less space than this — expect a final size of around 20GB.
Hit "Create"!
In VirtualBox's sidebar, select your new "Windows 10" and then click on the large gear "Settings" button.
In
General > Advanced
,
In Network > Adapter 1 switch from "NAT" to "Bridged Adapter". This will give your virtual machine access to any local servers running on the host.
Note that in System > Motherboard you can up the memory, and in System > Processor you can increase the number of processors. The default 1 works well for me, but if you want to play around with things that's where to do it.
When you're done with the settings, hit okay. Now double click on your VM in the VirtualBox sidebar. Click the "browse" icon, and locate the .iso
you downloaded.
At this point I recommend closing all other apps that take a lot of memory.
Hit "Start", and you should see the Windows 10 installer start up. Follow the installer.
That should be it for configuration. In a minute or two, after the installer spins for a bit, you should be looking at a Windows 10 computer! Now you can safely delete the Windows 10 disk image you downloaded at the start.
Now we'll remove that Microsoft account.
It's time to introduce some VM lingo: the computer on which the VM is installed is called the host, and the VM is called the guest. In this case, the Windows 10 machine is the guest, and your physical computer's system is the host.
VirtualBox provides a set of tools to extend your VM's powers, do support things like copying text in the host and pasting in the guest. The tools are called Guest Additions. Install them!
VirtualBox has several display options, configurable from the host's View menu. Note that you must install the Guest Additions, above, for these to work correctly.
After playing around with the options, you might have trouble getting back to the defaults. The trick is to select no Mode option.
When you're in a VirtualBox VM, all keystrokes are sent to the guest. To toggle this and send keystrokes to the host instead, hit the host key.
The current host key is named in the bottom right corner of the VM window. The icon immediately next to it, a downward-pointing arrow, indicates whether keystrokes are going "down" into guest. If it's lit up green, keystrokes are going to the guest; otherwise keystrokes are going to the host.
Use the host key, for example, to switch to a different host app. I find this especially handy in full screen mode: I hit the host key, then trigger the host's app switcher.
The host key can be customized. In the host's menubar, select VirtualBox VM > Preferences > Input > Virtual Machine.
Think of your VM as a real computer. Just as you turn a physical computer off with the operating system's "shut down" process, you should turn off your VM with its "shut down" process. That means that to turn off your Windows VM you don't quit the VirtualBox instance, you send the shut down signal from the Windows menu: open the menu and, click the power icon, and choose to turn the computer off. VirtualBox will automatically close the container app.
To turn on a VirtualBox VM, open VirtualBox and either select your VM and hit the "Start" button or simply double click the VM you want to start. You can also start the VM by opening its .vbox
file. If you want to do that (for example, if you want to keep the VM in your Dock) and don't remember the location you chose back in the VM setup step, right on the VM in VirtualBox and choose the "show" option.
Your system is all set up! Windows 10 comes with Edge and Internet Explorer 11.
To access IE11, open the Windows menu and start typing "internet explorer". Once it's open, you can right-click its icon in the taskbar and select "Pin to taskbar."
Just for completeness, I like to install Chrome and Firefox. The process is familiar to anyone familiar with Windows, but that might not be you!
I remove the Mail and Store icons from the taskbar: right click on them, and select "Unpin from taskbar".
I remove the Cortana search field from the taskbar: right click on an empty part of the taskbar, or on the Cortana search field, and in "Cortana" select "Hidden."
There you go, you're ready to test any Windows 10 browser right from your own computer!
Full interactive iOS Mobile Safari browser testing is possible right on your Mac, no additional services necessary. We'll set up Apple's Simulator and configure it for testing Safari on a wide range of iOS versions and devices.
Have an AWS task that's awkward when done in the web interface? AWS CLI sets up easily and has a full command suite