For a long time I've been thinking if it would be possible to use Selenium for testing layout of web applications. This would also be great since more and more websites go responsive nowadays. That made me rethink the whole approach around website testing and I came up with Galen Framework: a tool for automated testing of website layout and responsive design. It uses Selenium in order to open a browser, change the browser window size and get locations of tested elements on page. It allows to test the responsive web applications as well as cross-browser website compatibility via Selenium Grid. It has an expressive language which allows you to define the look of the website on different devices (browser sizes).

Here is how the basic syntax look like. The following example is just a simple test for a skeleton of a web-page on different sizes of browser (desktop, mobile):
# This is a comment. All comments start with '#' symbol

# This is the object definition on web page
header              id    header
menu                css  #menu
content             id   content
side-panel          id   side-panel
footer              id   footer

# The following are the test sections for different breakpoints on web page

@ all
    inside: screen 0px top, 0px left, 0px right

    inside: screen 0px left right
    below: header 0px

    below: menu 0px
    inside:screen 0px left

@ desktop
    below: menu 0px
    inside: screen 0px right
    width: 300px
    near: content 0px right

@ mobile
content, side-panel
    width: 100% of screen/width

    below: content 0px
You can run the code above by executing this command (of course you need to save the code in a file e.g. homepage.spec):
galen check homepage.spec --url "http://samples.galenframework.com/tutorial1/tutorial1.html" --size 1024x768 --include "all,desktop" --htmlreport desktop-reports
Or you can write your own test suite using the following syntax:
@@ Parameterized
   | device   | size       | tags        |
   | desktop  | 1024x768   | all,desktop |
   | mobile   | 400x600    | all,mobile  |
Home page in ${device} device
    http://samples.galenframework.com/tutorial1/tutorial1.html  ${size}
        check homepage.spec --include "${tags}"
And then run it like this (save the code in my.test file):
galen test my.test --htmlreport reports
The code samples above are just a brief overview of what galen is capable of. You can perform more advanced checks and test all possible layouts of complex web pages.

Official website for the tool is galenframework.com and it has a complete documentation.

Also there is an article which gives a better overview of Galen Framework: TDD for Responsive Design. Or how to automate testing of website layout for different devices | MindEngine.net

Looking forward for your feedback or ideas for future improvement. The tool is free and open-sourced. It is in beta and is constantly improving.