To be clear, as far as the user is concerned the statement “but the tests pass” is as useful as “but it works on my machine”, which is to say not at all!
Web applications have to run on a range of desktop web browsers including Chrome, Firefox, MS IE, MS Edge, Safari and Opera, as well as mobile browsers. So it makes sense to test them there, at least some of the time. If you have some bit of code that hits a strange bug in one of them it would be really nice to know that as you are developing the code.
I for one would feel really stupid if I shipped some code and then found that in browser X It does not work right and that if I ran my test suite in browser X it showed the fault! I’m sure it has happened to someone out there.
So how do you test on a range of browsers? First of all you will need to have all those browsers around, this can be done by one of several ways, the obvious one is to just download them all onto your workstation. But that may not work well, first of all if you are like most web developers you probably have a bunch of browser plugins installed that you don’t want in your test! Secondly if you are on a mac you won’t be able to install MS Edge or IE.
This is where virtual machines are your friend! Microsoft provides VMs for most versions of IE and EDGE. In addition you can get VM’s for Firefox, Chrome and Opera from the normal sources (Safari is harder).
In general I find that selenium scripts tend to be very fragile but you can easily create a selenium script that will open up the page with your tests on it and wait for it to tell you that it passed or failed without too much problem. If you do not feel like setting up your own selenium grid there are commercial services that will provide that for you.
Where do you run your tests? leave a comment and let me know!
Other blogposts on this..