Just push a button and have your website cross browser tested automatically. Doesn’t this sound nice? Today I will show you 2 different technologies to achieve exactly that!
Automated Layout Testing
If you first think about it automatically validating the layout of a website cross browser is not that difficult. But as always the devil is in the details. But don’t worry, it is still doable. I will break the process into 2 different steps: 1. Collecting screenshots in all necessary browsers and 2. Automatically comparing these screenshots to find layout issues.
Step 1: Collecting screenshots
This is the easier part and there are a few ways to do this:
- Create Screenshots using BrowserStack
- Automated screenshots using the BrowseEmAll commandline
- Use Selenium to create screenshots behind logins or other user interactions
Step 2: Comparing screenshots
Comparing images in general is not that hard but I would suggest these 2 different tools which gave me the best results in the past.
- Yahoo Blink-diff which is designed to compare screenshot of websites (open source)
- ImageMagick compare function
Both tools are script able and sufficient in most cases I have encountered.
Automated Functionality Testing
In my past experience the Selenium framework is currently the only choice to automate functional testing for any website or web application. Depending on the amount of testable functionality it can be quite a task to create all the test cases but once you have them rerunning them for every platform is a walk in the park. Here are some resources to get you started:
- How to structure you Selenium Tests
- Selenium & Maven Template
- Distributed Testing with Selenium Grid
- Hosted Selenium Grid in the Cloud (Gridlastic)
- Simplify Selenium Tests with BrowseEmAll
To get a good cross browser test done with Selenium it is important to run the tests separately in all browsers you are targeting. Selenium is currently supported by Internet Explorer, Firefox, Google Chrome, Safari, Microsoft Edge, Android and iOS.
As you can see it is quite possible to automate most of you cross browser testing. Now if only there was a tool that could do all that with the push of a button without any work done by the developer.