Using the Windows 8 Simulator & VS 2012 to Debug the IE10 Touch Events and Your Responsive Design
I’m currently working around the touch events of IE10 and even if I’m lucky enough to have a Windows 8 tablet, I was looking for a simpler way to do basic tests on my classical laptop without switching to the tablet each time. While looking for that, I’ve discovered several tips & tricks that may help you debugging the IE10 touch events in your code without even using a touch device. Nice side effect: the same approach will also help you to test & debug your responsive web design!
Pre-requisites: to follow this tutorial, you need first to:
1 – Download & install Windows 8 Release Preview on your machine: http://preview.windows.com
2 – Download & install Visual Studio 2012 RC Express for Windows 8: http://msdn.microsoft.com/en-us/windows/apps/br229516
The touch events model of Internet Explorer 10
If you don’t know yet how our touch implementation works, you should first read these 3 articles:
As a complement resource, you may have a look to the Pointer.JS library that mimics the IE10 model for the other browsers.
The Windows 8 Simulator to simulate touch
The Windows Simulator is installed with the development tools and is normally designed to help you testing & debugging your Metro Style Apps. You may learn a bit more details here: First look at Windows Simulator
Still, nothing prevents us to use it for debugging web applications running inside IE10 in the simulator. Let me show you how.
1 – Launch the simulator by launching the Microsoft.Windows.Simulator.exe located inside “Program Files (x86)\Common Files\Microsoft Shared\Windows Simulator\11.0”
And click on the desktop icon.
2 – Launch IE10, navigate to the “Internet Options” and “Advanced” tab. Check that both “Disable script debugging (Internet Explorer)” & “Disable script debugging (Other)” are not checked:
3 – Navigate to the URL you’d like to test and/or debug. For instance, let’s test this demo: Finger Painting from the IE Test Drive. Using the simulator, you can simulate classical mouse input and/or touch switching modes using this 2 buttons:
First, you’ll think you’ll get the exact same results:
But clicking on this button
will show you that you have a dual touch simulation for zooming & rotating:
These dual touch features are more interesting to use with such demos: Browser Surface
Using the simulator, you’ll be able to simulate zoom & rotation via touch gesture.
Another great solution is then to use the debugger of Visual Studio 2012. Here are the steps to follow for that:
1 – On your main session (outside of the simulator), launch Visual Studio 2012 RC Express and navigate to “DEBUG” –> “Attach to Process…”
2 – Locate the “iexplorer.exe” process (of type “x86, Script”) to attach to:
3 – If everything goes fine, you should have this result using the Browser Surface demo:
If it’s not the case, you’ve probably attached to the wrong iexplore.exe process or you’ve forgot to uncheck the disable script debugging options.
5 – Take an image and throw it using the touch simulation, it should automatically break into Visual Studio:
Testing & Debugging your Responsive Design
The Simulator and VS 2012 could be also some good friends to help you testing & debugging your responsive design. Let’s start by reviewing what the simulator has to offer for that.
I’ve searched on the web for the best websites implementing responsive design principles. I’ve chosen to use this one: http://garretkeizer.com/ for the following screenshots. You can find other cool websites to test on: http://mediaqueri.es
Here is the design of his website in Internet Explorer 10 using the default settings of the simulator:
Let’s now review some cool options of the simulator to go further.
1 – You can test how the design change in portrait or landscape mode by clicking on these buttons:
Here is the result for the chosen website:
2 – You can also simulate various forms factors and resolutions displays by clicking on this button:
3 – Here is the result of the same website in 2560x1440 (compared to the default 1366x768 of previous screenshots):
4 – Now if you want to go even further, you can use the awesome DOM Explorer tool of VS 2012 to help you reviewing & live editing your CSS. For instance, once the debugger is attached, you’ll see a window named “DOM Explorer”. While your mouse is hovering the HTML node, you’ll see in live the various areas highlighted in the simulator:
And of course, you’ll be able to review, edit & trace your styles in Visual Studio to potentially fix your CSS design.
I hope that these little tricks will help and save some of you time. You should then keep an eye on these free tools!
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)