Sunday, February 24, 2013

BrowserStack

As I mentioned some time ago Microsoft is offering free 3 month trial account in the BrowserStack service. Because I'm currently working on application that should support variety of browsers including old IE versions (fortunately starting from IE7 only - not IE6) I've decided to give it a try. I must say that I'm really impressed about it. But first let me explain some more details.

What is it

It is a service that gives us a possibility to use almost every browser running on operating system of our choice (but they are missing Linux - place to make some improvements in the future). We can have access to the remote browser running somewhere in the cloud to check how our application is working in it. No more using virtual machines, no more installing anything - BrowserStack is running in browser which simplifies a lot of things.

How it works - live sessions

First of all we can choose on which browser and on which operating system we want to test our application. Then in a very quick manner an instance of this browser is being prepared. Average preparation times were about 1 minute. It is acceptable because preparing your own virtual machine and starting it would definetely take much more time. After mentioned 1 minute we can control remote machine through some Adobe Flash application. It feels like remote desktop but limited to browser window. Of course we can use developer tools in almost every one of it - it is really good idea because without them service would be useless.


Tunneling

Most of applications that need to be tested are rather running locally on developer machine. For BrowserStack that isn't a problem - there is a tunneling feature to make our local sites available for the remote browsers. Tunnel is being prepared by simple Java application.

Automated testing

The most interesting thing is that with this service comes an API for making browser instances programatically (from any language where it is possible to send HTTP request). We can specify URL which should be opened when the browser will start. It is very useful because we can leverage automated JavaScript tests of our application. For example we can write and run Jasmine unit tests in the cloud. To collect test results from the remote browser we need something that can send data from the JavaScript code in the remote browser to our computer - and that is the place when node.js come in handy. There are several test runners on the internet (Testem, Yeti, etc.) that are built on the top of node.js and socket.io to send test results back to our computer through sockets. Of course they are travelling using tunnel that was prepared earlier.

Thursday, February 21, 2013

Disable attach security warning

Visual Studio by default is showing a message when trying to attach to process. It is saying that:
Attaching to this process can potentially harm your computer.  If the information below looks suspicious or you are unsure, do not attach to this process.
Because I'm attaching many times a day it becomes really annoying. Couple minutes of googling and here it is the solution for disabling it:
  1. First you need to make sure that Visual Studio isn't running.
  2. Next you need to modify registry key depending on which version of Visual Studio you have.

    For Visual Studio 2008:
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger

    For Visual Studio 2010:
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger

    For Visual Studio 2012:
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Debugger

    In all cases simply set DisableAttachSecurityWarning to 1.
That's all.

Wednesday, February 20, 2013

modern.IE

Recently Microsoft did something really interesting. Everybody knows that Internet Explorer (especially older versions) shouldn't be even called a browser. But still Microsoft Windows is the most popular operating system used commercially and so their browser is. Every web developer  knows that making something to work on the IE is really challenging task. Microsoft learned a lesson in couple of recent years and wanted to repair their image in that field. Internet Explorer 9 and 10 aren't the best browsers but in my opinion they are now acceptable. But they can't repair the old versions and years will past before they will disappear completely

So they have prepared a website: http://www.modern.ie which is trying to make developing web applications supporting Internet Explorer easier.


First of all they've prepared a tool that can scan our website and get a report that can help us improve general look and feel experience of our site. In some situations it can be helpful but it's always better to see how our site is looking in the real browser.

Second great feature is set of virtual machines with all Internet Explorer versions starting from IE7. Apart from that there is a nice bonus - 3 month free trial account in the BrowserStack - a service which we can use to test how our application is looking on a variety of browsers and operating systems, including mobile ones. This service is really amazing.

Microsoft prepared also a developers guide for applications that must work on older versions of their browsers.

All of that is really looking good and I think Microsoft realized how difficult it is to develop web sites for the IE. When developing on a computer that has a Internet Explorer 9 installed I've been using IE7 and IE8 modes to test if everything is ok with application, but to be honest I can remember several situations in which this mode doesn't really reflect true behavior of those old browsers. So it's a really step forward from Microsoft in the developers direction. Hopefully the next versions of Internet Explorer won't be so popular because of problems around them.